Skip to content

Commit d00c875

Browse files
committed
fix add admin user to zone permissions
1 parent 81079b8 commit d00c875

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/handlers/zone.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ func (zh *ZoneHandlers) AddZoneUserRole(c *gin.Context, id int64) {
254254

255255
// Check permissions
256256
if request.Role == "admin" {
257-
if role != "superuser" {
258-
c.JSON(http.StatusForbidden, gin.H{"error": "forbidden"})
257+
isAdmin, err := zh.isZoneAdmin(c, id, username)
258+
if role != "superuser" && (!isAdmin || err != nil) {
259259
return
260260
}
261261
} else if request.Role == "controller" {

0 commit comments

Comments
 (0)