diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-09-14 08:58:53 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-09-14 08:58:53 -0400 |
commit | c3742aef71801544172cf77a46d52835594096a4 (patch) | |
tree | 76b3aacf1ee6da724201ea5411bef068cce3b26a /api/context.go | |
parent | 75721b5cb5ea19c1d6754adcc82891fa888fcacf (diff) | |
parent | 714f47e015adf4a455d29cbddfb5f58f84d9973e (diff) | |
download | chat-c3742aef71801544172cf77a46d52835594096a4.tar.gz chat-c3742aef71801544172cf77a46d52835594096a4.tar.bz2 chat-c3742aef71801544172cf77a46d52835594096a4.zip |
Merge pull request #648 from mattermost/PLT-12
PLT-12: Work in progress for Admin Console UI
Diffstat (limited to 'api/context.go')
-rw-r--r-- | api/context.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/api/context.go b/api/context.go index ac5dbc7ec..d97295e5e 100644 --- a/api/context.go +++ b/api/context.go @@ -288,7 +288,8 @@ func (c *Context) HasPermissionsToChannel(sc store.StoreChannel, where string) b } func (c *Context) IsSystemAdmin() bool { - if strings.Contains(c.Session.Roles, model.ROLE_SYSTEM_ADMIN) && IsPrivateIpAddress(c.IpAddress) { + // TODO XXX FIXME && IsPrivateIpAddress(c.IpAddress) + if model.IsInRole(c.Session.Roles, model.ROLE_SYSTEM_ADMIN) { return true } return false @@ -300,7 +301,7 @@ func (c *Context) IsTeamAdmin(userId string) bool { return false } else { user := uresult.Data.(*model.User) - return strings.Contains(c.Session.Roles, model.ROLE_ADMIN) && user.TeamId == c.Session.TeamId + return model.IsInRole(c.Session.Roles, model.ROLE_TEAM_ADMIN) && user.TeamId == c.Session.TeamId } } |