diff options
author | Jesse Hallam <jesse.hallam@gmail.com> | 2018-10-09 15:25:57 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2018-10-09 12:25:57 -0700 |
commit | 59319b7915b8eb4c20a0d4878382cc0e41fc536d (patch) | |
tree | 604277129e22b19d3c91c9ae5ddf0023040d8b4f /api4/user_test.go | |
parent | fe9a81208e4d8290df7b8d89bac2d880c045b84b (diff) | |
download | chat-59319b7915b8eb4c20a0d4878382cc0e41fc536d.tar.gz chat-59319b7915b8eb4c20a0d4878382cc0e41fc536d.tar.bz2 chat-59319b7915b8eb4c20a0d4878382cc0e41fc536d.zip |
MM-12519: simplify autocomplete team id checking (#9577)
This handles clients sending a team id in a direct message or group channel autocomplete, when it necessarily won't match. Just verify that the user has permission for the team in question, whenever it is provided.
Diffstat (limited to 'api4/user_test.go')
-rw-r--r-- | api4/user_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api4/user_test.go b/api4/user_test.go index d50dfa3b6..405102373 100644 --- a/api4/user_test.go +++ b/api4/user_test.go @@ -873,9 +873,9 @@ func TestAutocompleteUsers(t *testing.T) { t.Fatal("should not show first/last name") } - t.Run("team id, if provided, must match channel's team id", func(t *testing.T) { + t.Run("user must have access to team id, especially when it does not match channel's team id", func(t *testing.T) { rusers, resp = Client.AutocompleteUsersInChannel("otherTeamId", channelId, username, "") - CheckErrorMessage(t, resp, "api.user.autocomplete_users.invalid_team_id") + CheckErrorMessage(t, resp, "api.context.permissions.app_error") }) } |