From e06e292be71ca699d90bafbd635118aa47c2d7a5 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Thu, 10 Sep 2015 18:32:22 -0700 Subject: PLT-12 adding log viewer --- api/context.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'api/context.go') 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 -- cgit v1.2.3-1-g7c22