Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Apr 28, 2024
1 parent 0577c47 commit fab72c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routes/teams/endpoints/edit_team_member/route.go
Expand Up @@ -110,7 +110,7 @@ func Route(d uapi.RouteData, r *http.Request) uapi.HttpResponse {
if !kittycat.HasPerm(managerPerms, kittycat.Build("team_member", teams.PermissionEdit)) {
return uapi.HttpResponse{
Status: http.StatusForbidden,
Json: types.ApiError{Message: "You do not have permission to edit this member"},
Json: types.ApiError{Message: "You do not have permission to edit team members"},
}
}

Expand Down Expand Up @@ -151,7 +151,7 @@ func Route(d uapi.RouteData, r *http.Request) uapi.HttpResponse {
}
}

if !kittycat.HasPerm(newPermsResolved, kittycat.Build("global", teams.PermissionOwner)) {
if !kittycat.HasPerm(newPermsResolved, kittycat.Build("global", teams.PermissionOwner)) && kittycat.HasPerm(currentUserPerms, kittycat.Build("global", teams.PermissionOwner)) {
// Ensure that if perm is owner, then there is another owner
var ownerCount int

Expand Down

0 comments on commit fab72c4

Please sign in to comment.