diff options
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 } |