77 "time"
88
99 activities_model "code.gitea.io/gitea/models/activities"
10+ "code.gitea.io/gitea/models/organization"
1011 "code.gitea.io/gitea/models/renderhelper"
1112 "code.gitea.io/gitea/modules/markup/markdown"
1213 "code.gitea.io/gitea/services/context"
@@ -28,12 +29,23 @@ func ShowUserFeedAtom(ctx *context.Context) {
2829// showUserFeed show user activity as RSS / Atom feed
2930func showUserFeed (ctx * context.Context , formatType string ) {
3031 includePrivate := ctx .IsSigned && (ctx .Doer .IsAdmin || ctx .Doer .ID == ctx .ContextUser .ID )
32+ isOrganisation := ctx .ContextUser .IsOrganization ()
33+ if isOrganisation && ! includePrivate {
34+ // When feed is requested by a member of the
35+ // organization, include the private repo's the member
36+ // has access to.
37+ isOrgMember , err := organization .IsOrganizationMember (ctx , ctx .ContextUser .ID , ctx .Doer .ID )
38+ if err != nil {
39+ ctx .ServerError ("IsOrganizationMember" , err )
40+ }
41+ includePrivate = isOrgMember
42+ }
3143
3244 actions , _ , err := feed_service .GetFeeds (ctx , activities_model.GetFeedsOptions {
3345 RequestedUser : ctx .ContextUser ,
3446 Actor : ctx .Doer ,
3547 IncludePrivate : includePrivate ,
36- OnlyPerformedBy : ! ctx . ContextUser . IsOrganization () ,
48+ OnlyPerformedBy : ! isOrganisation ,
3749 IncludeDeleted : false ,
3850 Date : ctx .FormString ("date" ),
3951 })
0 commit comments