File tree Expand file tree Collapse file tree 4 files changed +22
-15
lines changed Expand file tree Collapse file tree 4 files changed +22
-15
lines changed Original file line number Diff line number Diff line change @@ -386,7 +386,7 @@ func ListOrgActivityFeeds(ctx *context.APIContext) {
386
386
// required: true
387
387
// - name: date
388
388
// in: query
389
- // description: the date of the activities to be found, format is YYYY-MM-DD
389
+ // description: the date of the activities to be found
390
390
// type: string
391
391
// format: date
392
392
// - name: page
@@ -401,14 +401,21 @@ func ListOrgActivityFeeds(ctx *context.APIContext) {
401
401
// "200":
402
402
// "$ref": "#/responses/ActivityFeedsList"
403
403
404
- org := organization .OrgFromUser (ctx .ContextUser )
405
- isMember , err := org .IsOrgMember (ctx .Doer .ID )
406
- if err != nil {
407
- ctx .Error (http .StatusInternalServerError , "IsOrgMember" , err )
408
- return
404
+ includePrivate := false
405
+ if ctx .IsSigned {
406
+ if ctx .Doer .IsAdmin {
407
+ includePrivate = true
408
+ } else {
409
+ org := organization .OrgFromUser (ctx .ContextUser )
410
+ isMember , err := org .IsOrgMember (ctx .Doer .ID )
411
+ if err != nil {
412
+ ctx .Error (http .StatusInternalServerError , "IsOrgMember" , err )
413
+ return
414
+ }
415
+ includePrivate = isMember
416
+ }
409
417
}
410
418
411
- includePrivate := ctx .IsSigned && (ctx .Doer .IsAdmin || isMember )
412
419
listOptions := utils .GetListOptions (ctx )
413
420
414
421
opts := activities_model.GetFeedsOptions {
Original file line number Diff line number Diff line change @@ -809,7 +809,7 @@ func ListTeamActivityFeeds(ctx *context.APIContext) {
809
809
// required: true
810
810
// - name: date
811
811
// in: query
812
- // description: the date of the activities to be found, format is YYYY-MM-DD
812
+ // description: the date of the activities to be found
813
813
// type: string
814
814
// format: date
815
815
// - name: page
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ func ListUserActivityFeeds(ctx *context.APIContext) {
155
155
// parameters:
156
156
// - name: username
157
157
// in: path
158
- // description: username of user to get
158
+ // description: username of user
159
159
// type: string
160
160
// required: true
161
161
// - name: only-performed-by
@@ -164,7 +164,7 @@ func ListUserActivityFeeds(ctx *context.APIContext) {
164
164
// type: boolean
165
165
// - name: date
166
166
// in: query
167
- // description: the date of the activities to be found, format is YYYY-MM-DD
167
+ // description: the date of the activities to be found
168
168
// type: string
169
169
// format: date
170
170
// - name: page
Original file line number Diff line number Diff line change 1432
1432
{
1433
1433
"type": "string",
1434
1434
"format": "date",
1435
- "description": "the date of the activities to be found, format is YYYY-MM-DD ",
1435
+ "description": "the date of the activities to be found",
1436
1436
"name": "date",
1437
1437
"in": "query"
1438
1438
},
2927
2927
{
2928
2928
"type": "string",
2929
2929
"format": "date",
2930
- "description": "the date of the activities to be found, format is YYYY-MM-DD ",
2930
+ "description": "the date of the activities to be found",
2931
2931
"name": "date",
2932
2932
"in": "query"
2933
2933
},
12764
12764
{
12765
12765
"type": "string",
12766
12766
"format": "date",
12767
- "description": "the date of the activities to be found, format is YYYY-MM-DD ",
12767
+ "description": "the date of the activities to be found",
12768
12768
"name": "date",
12769
12769
"in": "query"
12770
12770
},
14460
14460
"parameters": [
14461
14461
{
14462
14462
"type": "string",
14463
- "description": "username of user to get ",
14463
+ "description": "username of user",
14464
14464
"name": "username",
14465
14465
"in": "path",
14466
14466
"required": true
14474
14474
{
14475
14475
"type": "string",
14476
14476
"format": "date",
14477
- "description": "the date of the activities to be found, format is YYYY-MM-DD ",
14477
+ "description": "the date of the activities to be found",
14478
14478
"name": "date",
14479
14479
"in": "query"
14480
14480
},
You can’t perform that action at this time.
0 commit comments