From 232a99f0c7b9364cb4386264f9ff7f97549a4378 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Mon, 3 Apr 2017 18:11:12 +0100 Subject: PLT-6162: Search for users not in a given team. (#5943) --- api4/user.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'api4/user.go') 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 -- cgit v1.2.3-1-g7c22