diff options
author | JoramWilander <jwawilander@gmail.com> | 2017-08-08 16:20:07 -0400 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2017-08-08 16:20:07 -0400 |
commit | 1885d2ec2ab6870b735f08752f5354e9f624d87f (patch) | |
tree | 5ec059b473ca28ca0c6343d7c82ff4fbff43a616 /api4/team.go | |
parent | 70fe9e9e971943b108492b1814a23bd42eae8ae2 (diff) | |
download | chat-1885d2ec2ab6870b735f08752f5354e9f624d87f.tar.gz chat-1885d2ec2ab6870b735f08752f5354e9f624d87f.tar.bz2 chat-1885d2ec2ab6870b735f08752f5354e9f624d87f.zip |
Minor updates to team
Diffstat (limited to 'api4/team.go')
-rw-r--r-- | api4/team.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api4/team.go b/api4/team.go index 98a672d93..b71b285e6 100644 --- a/api4/team.go +++ b/api4/team.go @@ -85,7 +85,7 @@ func getTeam(c *Context, w http.ResponseWriter, r *http.Request) { c.Err = err return } else { - if team.Type != model.TEAM_OPEN && !app.SessionHasPermissionToTeam(c.Session, team.Id, model.PERMISSION_VIEW_TEAM) { + if (!team.AllowOpenInvite || team.Type != model.TEAM_OPEN) && !app.SessionHasPermissionToTeam(c.Session, team.Id, model.PERMISSION_VIEW_TEAM) { c.SetPermissionError(model.PERMISSION_VIEW_TEAM) return } @@ -105,7 +105,7 @@ func getTeamByName(c *Context, w http.ResponseWriter, r *http.Request) { c.Err = err return } else { - if team.Type != model.TEAM_OPEN && !app.SessionHasPermissionToTeam(c.Session, team.Id, model.PERMISSION_VIEW_TEAM) { + if (!team.AllowOpenInvite || team.Type != model.TEAM_OPEN) && !app.SessionHasPermissionToTeam(c.Session, team.Id, model.PERMISSION_VIEW_TEAM) { c.SetPermissionError(model.PERMISSION_VIEW_TEAM) return } |