Skip to content

Commit 7a56248

Browse files
update group web context
ensure we 404 if the group is not accessible
1 parent fa2a2f2 commit 7a56248

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

services/context/group.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,16 @@ func GroupAssignment(args GroupAssignmentOptions) func(ctx *Context) {
106106
ctx.NotFound(err)
107107
return
108108
}
109+
canAccess, err := ctx.RepoGroup.Group.CanAccess(ctx, ctx.Doer)
110+
if err != nil {
111+
ctx.ServerError("error checking group access", err)
112+
return
113+
}
114+
if !canAccess {
115+
ctx.NotFound(nil)
116+
return
117+
}
118+
109119
if ctx.RepoGroup.Group.Visibility == structs.VisibleTypePrivate {
110120
args.RequireMember = true
111121
} else if ctx.IsSigned && ctx.Doer.IsRestricted {

0 commit comments

Comments
 (0)