From 58d0d9afd286afd715e9f04825e1305045d404e2 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Fri, 4 Sep 2015 11:59:10 -0700 Subject: Adding cmd line options --- api/context.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'api/context.go') diff --git a/api/context.go b/api/context.go index aaf304e2c..2beea2408 100644 --- a/api/context.go +++ b/api/context.go @@ -285,7 +285,7 @@ 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) { + if model.IsInRole(c.Session.Roles, model.ROLE_SYSTEM_ADMIN) && IsPrivateIpAddress(c.IpAddress) { return true } return false @@ -297,7 +297,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_ADMIN) && user.TeamId == c.Session.TeamId } } -- cgit v1.2.3-1-g7c22 From 8bf35081c80a56051037d0bc374e9fec3fb9529e Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Thu, 10 Sep 2015 14:56:37 -0700 Subject: PLT-12 UI framework for admin console --- api/context.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'api/context.go') diff --git a/api/context.go b/api/context.go index 2beea2408..1852ed4d6 100644 --- a/api/context.go +++ b/api/context.go @@ -285,7 +285,8 @@ func (c *Context) HasPermissionsToChannel(sc store.StoreChannel, where string) b } func (c *Context) IsSystemAdmin() bool { - if model.IsInRole(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 -- cgit v1.2.3-1-g7c22 From e5e88d16049f4527eaab6b066c731fbe4247b574 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Fri, 11 Sep 2015 09:39:28 -0700 Subject: Renaming ROLE_ADMIN to ROLE_TEAM_ADMIN --- api/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api/context.go') diff --git a/api/context.go b/api/context.go index 1852ed4d6..8e5becda7 100644 --- a/api/context.go +++ b/api/context.go @@ -298,7 +298,7 @@ func (c *Context) IsTeamAdmin(userId string) bool { return false } else { user := uresult.Data.(*model.User) - return model.IsInRole(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 } } -- cgit v1.2.3-1-g7c22