diff options
author | =Corey Hulen <corey@hulen.com> | 2015-09-10 18:32:22 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-09-10 18:32:22 -0700 |
commit | e06e292be71ca699d90bafbd635118aa47c2d7a5 (patch) | |
tree | 3f8f7ce86a1618f625e71084041746745139ba0c /api/context.go | |
parent | 41439eb801c6c8c0a55bcada3eeba3b4a561c663 (diff) | |
download | chat-e06e292be71ca699d90bafbd635118aa47c2d7a5.tar.gz chat-e06e292be71ca699d90bafbd635118aa47c2d7a5.tar.bz2 chat-e06e292be71ca699d90bafbd635118aa47c2d7a5.zip |
PLT-12 adding log viewer
Diffstat (limited to 'api/context.go')
-rw-r--r-- | api/context.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/api/context.go b/api/context.go index 1852ed4d6..ea5677f95 100644 --- a/api/context.go +++ b/api/context.go @@ -292,6 +292,16 @@ func (c *Context) IsSystemAdmin() bool { return false } +func (c *Context) HasSystemAdminPermissions(where string) bool { + if c.IsSystemAdmin() { + return true + } + + c.Err = model.NewAppError(where, "You do not have the appropriate permissions", "userId="+c.Session.UserId) + c.Err.StatusCode = http.StatusForbidden + return false +} + func (c *Context) IsTeamAdmin(userId string) bool { if uresult := <-Srv.Store.User().Get(userId); uresult.Err != nil { c.Err = uresult.Err |