mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-13 21:56:10 +02:00
update group web context
ensure we 404 if the group is not accessible
This commit is contained in:
parent
b28493db6c
commit
cb563434ee
@ -106,6 +106,16 @@ func GroupAssignment(args GroupAssignmentOptions) func(ctx *Context) {
|
|||||||
ctx.NotFound(err)
|
ctx.NotFound(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
canAccess, err := ctx.RepoGroup.Group.CanAccess(ctx, ctx.Doer)
|
||||||
|
if err != nil {
|
||||||
|
ctx.ServerError("error checking group access", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !canAccess {
|
||||||
|
ctx.NotFound(nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if ctx.RepoGroup.Group.Visibility == structs.VisibleTypePrivate {
|
if ctx.RepoGroup.Group.Visibility == structs.VisibleTypePrivate {
|
||||||
args.RequireMember = true
|
args.RequireMember = true
|
||||||
} else if ctx.IsSigned && ctx.Doer.IsRestricted {
|
} else if ctx.IsSigned && ctx.Doer.IsRestricted {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user