summaryrefslogtreecommitdiffstats
path: root/api4/user.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-04-03 18:11:12 +0100
committerHarrison Healey <harrisonmhealey@gmail.com>2017-04-03 13:11:12 -0400
commit232a99f0c7b9364cb4386264f9ff7f97549a4378 (patch)
tree8f90f7e4fae36b7043e6ab360aafe9e0769060ac /api4/user.go
parentda5265681d42549ad9072d762fec67293d742d43 (diff)
downloadchat-232a99f0c7b9364cb4386264f9ff7f97549a4378.tar.gz
chat-232a99f0c7b9364cb4386264f9ff7f97549a4378.tar.bz2
chat-232a99f0c7b9364cb4386264f9ff7f97549a4378.zip
PLT-6162: Search for users not in a given team. (#5943)
Diffstat (limited to 'api4/user.go')
-rw-r--r--api4/user.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/api4/user.go b/api4/user.go
index e4595ee54..593d704a5 100644
--- a/api4/user.go
+++ b/api4/user.go
@@ -397,6 +397,11 @@ func searchUsers(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
+ if props.NotInTeamId != "" && !app.SessionHasPermissionToTeam(c.Session, props.NotInTeamId, model.PERMISSION_VIEW_TEAM) {
+ c.SetPermissionError(model.PERMISSION_VIEW_TEAM)
+ return
+ }
+
searchOptions := map[string]bool{}
searchOptions[store.USER_SEARCH_OPTION_ALLOW_INACTIVE] = props.AllowInactive