mirror of
https://github.com/go-gitea/gitea
synced 2025-07-29 13:48:36 +00:00
rework heatmap permissions (#14080)
* now uses the same permission model as for the activity feed: only include activities in repos, that the doer has access to. this might be somewhat slower. * also improves handling of user.KeepActivityPrivate (still shows the heatmap to self & admins) * extend tests * adjust integration test to new behaviour * add access to actions for admins * extend heatmap unit tests
This commit is contained in:
@@ -115,7 +115,7 @@ func Dashboard(ctx *context.Context) {
|
||||
// no heatmap access for admins; GetUserHeatmapDataByUser ignores the calling user
|
||||
// so everyone would get the same empty heatmap
|
||||
if setting.Service.EnableUserHeatmap && !ctxUser.KeepActivityPrivate {
|
||||
data, err := models.GetUserHeatmapDataByUser(ctxUser)
|
||||
data, err := models.GetUserHeatmapDataByUser(ctxUser, ctx.User)
|
||||
if err != nil {
|
||||
ctx.ServerError("GetUserHeatmapDataByUser", err)
|
||||
return
|
||||
|
@@ -98,7 +98,7 @@ func Profile(ctx *context.Context) {
|
||||
// no heatmap access for admins; GetUserHeatmapDataByUser ignores the calling user
|
||||
// so everyone would get the same empty heatmap
|
||||
if setting.Service.EnableUserHeatmap && !ctxUser.KeepActivityPrivate {
|
||||
data, err := models.GetUserHeatmapDataByUser(ctxUser)
|
||||
data, err := models.GetUserHeatmapDataByUser(ctxUser, ctx.User)
|
||||
if err != nil {
|
||||
ctx.ServerError("GetUserHeatmapDataByUser", err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user