MM-15162: Changes for LDAP groups removals. (#10701)

* MM-15162: Changes for LDAP groups removals phase.

* MM-15162: Adds missing translation.

* MM-15162: Fixes tests.

* MM-15162: Removes some confusing branching.

* MM-15162: Make permission less restrictive.

* MM-15162: Moves counting to the DB tier.

* MM-15162: Moves CountGroupsByTeam into own store method.

* MM-15162: Adds count to tests.

* MM-15162: Fix for wrong cast type.

* MM-15162: Fix for possible null SchemeGuest column.

* MM-15162: Fixes bug whereby permissions error didn't return.

* MM-15162: Changes for LDAP groups removals phase.

* MM-15162: Adds missing translation.

* MM-15162: Fixes tests.

* MM-15162: Removes some confusing branching.

* MM-15162: Make permission less restrictive.

* MM-15162: Moves counting to the DB tier.

* MM-15162: Moves CountGroupsByTeam into own store method.

* MM-15162: Adds count to tests.

* MM-15162: Fix for wrong cast type.

* MM-15162: Fix for possible null SchemeGuest column.

* MM-15162: Fixes bug whereby permissions error didn't return.

* MM-15162: Adds missing translation blocking enterprise build.

* MM-15162: Update to group commands.
Этот коммит содержится в:
Martin Kraft
2019-05-10 11:47:21 -04:00
коммит произвёл GitHub
родитель 74c7c46a7d
Коммит 480fffd3cc
24 изменённых файлов: 1001 добавлений и 146 удалений

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

@@ -173,8 +173,24 @@ func (a *App) GetGroupsByChannel(channelId string, page, perPage int) ([]*model.
return result.Data.([]*model.Group), nil
}
func (a *App) GetGroupsByTeam(teamId string, page, perPage int) ([]*model.Group, *model.AppError) {
result := <-a.Srv.Store.Group().GetGroupsByTeam(teamId, page, perPage)
func (a *App) GetGroupsByTeam(teamId string, opts model.GroupSearchOpts) ([]*model.Group, int, *model.AppError) {
result := <-a.Srv.Store.Group().GetGroupsByTeam(teamId, opts)
if result.Err != nil {
return nil, 0, result.Err
}
groups := result.Data.([]*model.Group)
result = <-a.Srv.Store.Group().CountGroupsByTeam(teamId, opts)
if result.Err != nil {
return nil, 0, result.Err
}
count := result.Data.(int64)
return groups, int(count), nil
}
func (a *App) GetGroups(page, perPage int, opts model.GroupSearchOpts) ([]*model.Group, *model.AppError) {
result := <-a.Srv.Store.Group().GetGroups(page, perPage, opts)
if result.Err != nil {
return nil, result.Err
}