[GH-7494] Added the role to the user search filter (#9976)

* 7494 added the role to the user search filter

* 7494 changed the getUser function to accept the options

* added the role filter for the getAllProfiles method

* 7494 added the Inactive filter for AllProfiles

* 7494 refactored the where clause generation

* 7494 added the roles and inactive filters for inTeam Query

* 7494 fixed the review comments
Этот коммит содержится в:
Pradeep Murugesan
2019-01-11 14:50:32 +01:00
коммит произвёл George Goldberg
родитель 09a519799f
Коммит bbee234af0
11 изменённых файлов: 321 добавлений и 70 удалений

27
model/user_get.go Обычный файл
Просмотреть файл

@@ -0,0 +1,27 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package model
type UserGetOptions struct {
// Filters the users in the team
InTeamId string
// Filters the users not in the team
NotInTeamId string
// Filters the users in the channel
InChannelId string
// Filters the users not in the channel
NotInChannelId string
// Filters the users without a team
WithoutTeam bool
// Filters the inactive users
Inactive bool
// Filters for the given role
Role string
// Sorting option
Sort string
// Page
Page int
// Page size
PerPage int
}

Просмотреть файл

@@ -21,6 +21,7 @@ type UserSearch struct {
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
@@ -54,4 +55,6 @@ type UserSearchOptions struct {
AllowInactive bool
// Limit limits the total number of results returned.
Limit int
// Filters for the given role
Role string
}