Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
users with role 'admin' are allowed to delete centers from other users
Browse files Browse the repository at this point in the history
  • Loading branch information
dreske committed Sep 15, 2021
1 parent 6914331 commit f2aea68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/centers.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func (c *Centers) DeleteCenter(_ http.ResponseWriter, r *http.Request) (interfac
return nil, err
}

if center.OperatorUUID != operator.UUID {
if center.OperatorUUID != operator.UUID && !security.HasRole(r.Context(), security.RoleAdmin) {
return nil, security.ErrForbidden
}

Expand Down

0 comments on commit f2aea68

Please sign in to comment.