Этот коммит содержится в:
=Corey Hulen
2015-09-10 18:32:22 -07:00
родитель 41439eb801
Коммит e06e292be7
14 изменённых файлов: 338 добавлений и 15 удалений

Просмотреть файл

@@ -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