diff options
author | =Corey Hulen <corey@hulen.com> | 2015-09-23 15:16:48 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-09-23 15:16:48 -0700 |
commit | 985aebf86120188c2a14adfab39af7c4da3c1c9d (patch) | |
tree | 45f4421eec697be3750a59f298e97bf6c39ade79 /api/user.go | |
parent | 7f3bfdbe0c2442714bb5a14adfdeac1576123601 (diff) | |
download | chat-985aebf86120188c2a14adfab39af7c4da3c1c9d.tar.gz chat-985aebf86120188c2a14adfab39af7c4da3c1c9d.tar.bz2 chat-985aebf86120188c2a14adfab39af7c4da3c1c9d.zip |
Fixing state setting
Diffstat (limited to 'api/user.go')
-rw-r--r-- | api/user.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/user.go b/api/user.go index 5be703bfb..2edbde3e2 100644 --- a/api/user.go +++ b/api/user.go @@ -938,8 +938,8 @@ func updateRoles(c *Context, w http.ResponseWriter, r *http.Request) { return } - if model.IsInRole(new_roles, model.ROLE_SYSTEM_ADMIN) { - c.Err = model.NewAppError("updateRoles", "The system_admin role can only be set from the command line", "") + 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.StatusCode = http.StatusForbidden return } |