summaryrefslogtreecommitdiffstats
path: root/api/team.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-09-30 11:30:11 -0400
committerChristopher Speller <crspeller@gmail.com>2015-09-30 14:26:37 -0400
commit7d31f3a271d933b8c276602d9fb77fd5d22055de (patch)
treeb836506cc084e1907e39ca0d7283a4175a25ba50 /api/team.go
parent89b77cc72ffd9dec6242f66277a4aeffe6fb737b (diff)
downloadchat-7d31f3a271d933b8c276602d9fb77fd5d22055de.tar.gz
chat-7d31f3a271d933b8c276602d9fb77fd5d22055de.tar.bz2
chat-7d31f3a271d933b8c276602d9fb77fd5d22055de.zip
Fixing some locations to use the IsTeamAdmin function which properly checks for system admin permissions.
Diffstat (limited to 'api/team.go')
-rw-r--r--api/team.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/api/team.go b/api/team.go
index 4794b66df..cff34390a 100644
--- a/api/team.go
+++ b/api/team.go
@@ -506,7 +506,7 @@ func InviteMembers(c *Context, team *model.Team, user *model.User, invites []str
sender := user.GetDisplayName()
senderRole := ""
- if model.IsInRole(user.Roles, model.ROLE_TEAM_ADMIN) || model.IsInRole(user.Roles, model.ROLE_SYSTEM_ADMIN) {
+ if c.IsTeamAdmin() {
senderRole = "administrator"
} else {
senderRole = "member"
@@ -566,7 +566,7 @@ func updateTeamDisplayName(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- if !model.IsInRole(c.Session.Roles, model.ROLE_TEAM_ADMIN) {
+ if !c.IsTeamAdmin() {
c.Err = model.NewAppError("updateTeamDisplayName", "You do not have the appropriate permissions", "userId="+c.Session.UserId)
c.Err.StatusCode = http.StatusForbidden
return
@@ -600,7 +600,7 @@ func getMyTeam(c *Context, w http.ResponseWriter, r *http.Request) {
}
func importTeam(c *Context, w http.ResponseWriter, r *http.Request) {
- if !c.HasPermissionsToTeam(c.Session.TeamId, "import") || !c.IsTeamAdmin(c.Session.UserId) {
+ if !c.HasPermissionsToTeam(c.Session.TeamId, "import") || !c.IsTeamAdmin() {
c.Err = model.NewAppError("importTeam", "Only a team admin can import data.", "userId="+c.Session.UserId)
c.Err.StatusCode = http.StatusForbidden
return
@@ -667,7 +667,7 @@ func importTeam(c *Context, w http.ResponseWriter, r *http.Request) {
}
func exportTeam(c *Context, w http.ResponseWriter, r *http.Request) {
- if !c.HasPermissionsToTeam(c.Session.TeamId, "export") || !c.IsTeamAdmin(c.Session.UserId) {
+ if !c.HasPermissionsToTeam(c.Session.TeamId, "export") || !c.IsTeamAdmin() {
c.Err = model.NewAppError("exportTeam", "Only a team admin can export data.", "userId="+c.Session.UserId)
c.Err.StatusCode = http.StatusForbidden
return