summaryrefslogtreecommitdiffstats
path: root/api/context.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-09-15 15:59:29 -0400
committerChristopher Speller <crspeller@gmail.com>2015-09-15 15:59:29 -0400
commit1bbb5265be24476faa2d44f8538918708391bde8 (patch)
tree5f1b30ec8a4cf1dfa1366b7945accb502add43ba /api/context.go
parentbbb0607e1ddf3e3d530095ba2aa28abd9c49a3e4 (diff)
parent23a1311ef5f9ecac0a250419a49e74b290e63516 (diff)
downloadchat-1bbb5265be24476faa2d44f8538918708391bde8.tar.gz
chat-1bbb5265be24476faa2d44f8538918708391bde8.tar.bz2
chat-1bbb5265be24476faa2d44f8538918708391bde8.zip
Merge pull request #681 from mattermost/PLT-12-log
PLT-12 Adding server logs viewer to admin console
Diffstat (limited to 'api/context.go')
-rw-r--r--api/context.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/api/context.go b/api/context.go
index d97295e5e..fc7d8f23d 100644
--- a/api/context.go
+++ b/api/context.go
@@ -295,6 +295,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