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() {
|
||||
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
|
||||
return
|
||||
}
|
||||
@@ -1014,6 +1014,12 @@ func updateRoles(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
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)
|
||||
if c.Err != nil {
|
||||
return
|
||||
|
||||
Ссылка в новой задаче
Block a user