We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81079b8 commit d00c875Copy full SHA for d00c875
src/handlers/zone.go
@@ -254,8 +254,8 @@ func (zh *ZoneHandlers) AddZoneUserRole(c *gin.Context, id int64) {
254
255
// Check permissions
256
if request.Role == "admin" {
257
- if role != "superuser" {
258
- c.JSON(http.StatusForbidden, gin.H{"error": "forbidden"})
+ isAdmin, err := zh.isZoneAdmin(c, id, username)
+ if role != "superuser" && (!isAdmin || err != nil) {
259
return
260
}
261
} else if request.Role == "controller" {
0 commit comments