Adding checkout for system admin role
Этот коммит содержится в:
@@ -991,7 +991,7 @@ func updateRoles(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if model.IsInRole(new_roles, model.ROLE_SYSTEM_ADMIN) && !c.IsSystemAdmin() {
|
if model.IsInRole(new_roles, model.ROLE_SYSTEM_ADMIN) && !c.IsSystemAdmin() {
|
||||||
c.Err = model.NewAppError("updateRoles", "The system_admin role can only be set by another system admin", "")
|
c.Err = model.NewAppError("updateRoles", "The system admin role can only be set by another system admin", "")
|
||||||
c.Err.StatusCode = http.StatusForbidden
|
c.Err.StatusCode = http.StatusForbidden
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -1014,6 +1014,12 @@ func updateRoles(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if user.IsInRole(model.ROLE_SYSTEM_ADMIN) && !c.IsSystemAdmin() {
|
||||||
|
c.Err = model.NewAppError("updateRoles", "The system admin role can only by modified by another system admin", "")
|
||||||
|
c.Err.StatusCode = http.StatusForbidden
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
ruser := UpdateRoles(c, user, new_roles)
|
ruser := UpdateRoles(c, user, new_roles)
|
||||||
if c.Err != nil {
|
if c.Err != nil {
|
||||||
return
|
return
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user