Skip to content

Commit

Permalink
Allow adminstrator teams members to see other teams (go-gitea#18918)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gusted committed Feb 26, 2022
1 parent ce75461 commit 8b086e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/context/org.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {

// Team.
if ctx.Org.IsMember {
if ctx.Org.IsOwner {
maxPerm, err := org.GetOrgUserMaxAuthorizeLevel(ctx.User.ID)
if err != nil {
ctx.ServerError("GetOrgUserMaxAuthorizeLevel", err)
}
if ctx.Org.IsOwner || maxPerm >= perm.AccessModeAdmin {
ctx.Org.Teams, err = org.LoadTeams()
if err != nil {
ctx.ServerError("LoadTeams", err)
Expand Down

0 comments on commit 8b086e7

Please sign in to comment.