summaryrefslogtreecommitdiffstats
path: root/api/user.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-09-30 14:52:51 -0400
committerChristopher Speller <crspeller@gmail.com>2015-09-30 14:52:51 -0400
commite99e93fafbb6c974129ba09a35ddb85e2102f00d (patch)
tree6836aebf1b99083a501c4c3305326237625ceb3a /api/user.go
parent6a9cfe2f241f0eed8d6b2c943a8fd04cc1a14019 (diff)
parent7d31f3a271d933b8c276602d9fb77fd5d22055de (diff)
downloadchat-e99e93fafbb6c974129ba09a35ddb85e2102f00d.tar.gz
chat-e99e93fafbb6c974129ba09a35ddb85e2102f00d.tar.bz2
chat-e99e93fafbb6c974129ba09a35ddb85e2102f00d.zip
Merge pull request #884 from mattermost/permissions-fix
Permissions fixes. Fixes PLT-487
Diffstat (limited to 'api/user.go')
-rw-r--r--api/user.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/user.go b/api/user.go
index 92a77e68a..a5c3fca2b 100644
--- a/api/user.go
+++ b/api/user.go
@@ -969,7 +969,7 @@ func updateRoles(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- if !model.IsInRole(c.Session.Roles, model.ROLE_TEAM_ADMIN) && !c.IsSystemAdmin() {
+ if !c.IsTeamAdmin() {
c.Err = model.NewAppError("updateRoles", "You do not have the appropriate permissions", "userId="+user_id)
c.Err.StatusCode = http.StatusForbidden
return
@@ -1066,7 +1066,7 @@ func updateActive(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- if !model.IsInRole(c.Session.Roles, model.ROLE_TEAM_ADMIN) && !c.IsSystemAdmin() {
+ if !c.IsTeamAdmin() {
c.Err = model.NewAppError("updateActive", "You do not have the appropriate permissions", "userId="+user_id)
c.Err.StatusCode = http.StatusForbidden
return