allow everyone to see full heatmap

This commit is contained in:
Daniella / Tove 2024-06-16 14:32:44 +02:00 committed by TudbuT
parent 1e7b368ccf
commit 76449a989d
Signed by: TudbuT
GPG key ID: B3CF345217F202D3
3 changed files with 9 additions and 1 deletions

6
FORK.md Normal file
View file

@ -0,0 +1,6 @@
# TudbuT FORK
## Changes:
- Allow anyone to see the activity heatmap in full

View file

@ -440,6 +440,7 @@ type GetFeedsOptions struct {
OnlyPerformedByActor bool // only actions performed by the original actor OnlyPerformedByActor bool // only actions performed by the original actor
IncludeDeleted bool // include deleted actions IncludeDeleted bool // include deleted actions
Date string // the day we want activity for: YYYY-MM-DD Date string // the day we want activity for: YYYY-MM-DD
IncludeInaccessible bool // if inaccessible activities should be included
} }
// GetFeeds returns actions according to the provided options // GetFeeds returns actions according to the provided options
@ -526,7 +527,7 @@ func activityQueryCondition(ctx context.Context, opts GetFeedsOptions) (builder.
} }
// check readable repositories by doer/actor // check readable repositories by doer/actor
if opts.Actor == nil || !opts.Actor.IsAdmin { if !opts.IncludeInaccessible && (opts.Actor == nil || !opts.Actor.IsAdmin) {
cond = cond.And(builder.In("repo_id", repo_model.AccessibleRepoIDsQuery(opts.Actor))) cond = cond.And(builder.In("repo_id", repo_model.AccessibleRepoIDsQuery(opts.Actor)))
} }

View file

@ -53,6 +53,7 @@ func getUserHeatmapData(ctx context.Context, user *user_model.User, team *organi
// * For organizations actions by all users that were made in owned // * For organizations actions by all users that were made in owned
// repositories are counted. // repositories are counted.
OnlyPerformedBy: !user.IsOrganization(), OnlyPerformedBy: !user.IsOrganization(),
IncludeInaccessible: true,
}) })
if err != nil { if err != nil {
return nil, err return nil, err