[MM-14751] Adds group_constrained filter to user list and search endpoints (#10678)

This commit is contained in:
Miguel de la Cruz
2019-05-16 10:12:06 +01:00
committed by GitHub
parent beb7592c93
commit 098dbc84cc
9 changed files with 206 additions and 85 deletions

View File

@@ -12,6 +12,8 @@ type UserGetOptions struct {
InChannelId string
// Filters the users not in the channel
NotInChannelId string
// Filters the users group constrained
GroupConstrained bool
// Filters the users without a team
WithoutTeam bool
// Filters the inactive users

View File

@@ -13,15 +13,16 @@ const USER_SEARCH_DEFAULT_LIMIT = 100
// UserSearch captures the parameters provided by a client for initiating a user search.
type UserSearch struct {
Term string `json:"term"`
TeamId string `json:"team_id"`
NotInTeamId string `json:"not_in_team_id"`
InChannelId string `json:"in_channel_id"`
NotInChannelId string `json:"not_in_channel_id"`
AllowInactive bool `json:"allow_inactive"`
WithoutTeam bool `json:"without_team"`
Limit int `json:"limit"`
Role string `json:"role"`
Term string `json:"term"`
TeamId string `json:"team_id"`
NotInTeamId string `json:"not_in_team_id"`
InChannelId string `json:"in_channel_id"`
NotInChannelId string `json:"not_in_channel_id"`
GroupConstrained bool `json:"group_constrained"`
AllowInactive bool `json:"allow_inactive"`
WithoutTeam bool `json:"without_team"`
Limit int `json:"limit"`
Role string `json:"role"`
}
// ToJson convert a User to a json string
@@ -53,6 +54,8 @@ type UserSearchOptions struct {
AllowFullNames bool
// AllowInactive configures whether or not to return inactive users in the search results.
AllowInactive bool
// Narrows the search to the group constrained users
GroupConstrained bool
// Limit limits the total number of results returned.
Limit int
// Filters for the given role