diff options
Diffstat (limited to 'api/user.go')
-rw-r--r-- | api/user.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/api/user.go b/api/user.go index 7e5a50fc4..5c44ec1f6 100644 --- a/api/user.go +++ b/api/user.go @@ -2859,7 +2859,17 @@ func autocompleteUsersInTeam(c *Context, w http.ResponseWriter, r *http.Request) func autocompleteUsers(c *Context, w http.ResponseWriter, r *http.Request) { term := r.URL.Query().Get("term") - uchan := Srv.Store.User().Search("", term, map[string]bool{}) + searchOptions := map[string]bool{} + + hideFullName := !utils.Cfg.PrivacySettings.ShowFullName + if hideFullName && !HasPermissionToContext(c, model.PERMISSION_MANAGE_SYSTEM) { + searchOptions[store.USER_SEARCH_OPTION_NAMES_ONLY_NO_FULL_NAME] = true + c.Err = nil + } else { + searchOptions[store.USER_SEARCH_OPTION_NAMES_ONLY] = true + } + + uchan := Srv.Store.User().Search("", term, searchOptions) var profiles []*model.User |