7
7
"time"
8
8
9
9
activities_model "code.gitea.io/gitea/models/activities"
10
+ "code.gitea.io/gitea/models/organization"
10
11
"code.gitea.io/gitea/models/renderhelper"
11
12
"code.gitea.io/gitea/modules/markup/markdown"
12
13
"code.gitea.io/gitea/services/context"
@@ -28,12 +29,23 @@ func ShowUserFeedAtom(ctx *context.Context) {
28
29
// showUserFeed show user activity as RSS / Atom feed
29
30
func showUserFeed (ctx * context.Context , formatType string ) {
30
31
includePrivate := ctx .IsSigned && (ctx .Doer .IsAdmin || ctx .Doer .ID == ctx .ContextUser .ID )
32
+ isOrganisation := ctx .ContextUser .IsOrganization ()
33
+ if ctx .IsSigned && 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
+ }
31
43
32
44
actions , _ , err := feed_service .GetFeeds (ctx , activities_model.GetFeedsOptions {
33
45
RequestedUser : ctx .ContextUser ,
34
46
Actor : ctx .Doer ,
35
47
IncludePrivate : includePrivate ,
36
- OnlyPerformedBy : ! ctx . ContextUser . IsOrganization () ,
48
+ OnlyPerformedBy : ! isOrganisation ,
37
49
IncludeDeleted : false ,
38
50
Date : ctx .FormString ("date" ),
39
51
})
0 commit comments