MM-16783 Migrate "Team.UserBelongsToTeams" to Sync by default (#11589)
* Migrated UserBelongsToTeams to a syncronous method * Updated the Store interface * Updated calls and removed now obsolete wrapper * Regenerated store mocks * Reverted wrong method call
Этот коммит содержится в:
коммит произвёл
Jesús Espino
родитель
1640702d5e
Коммит
902521f7d3
10
app/user.go
10
app/user.go
@@ -2086,7 +2086,7 @@ func (a *App) UserCanSeeOtherUser(userId string, otherUserId string) (bool, *mod
|
||||
}
|
||||
|
||||
if len(restrictions.Teams) > 0 {
|
||||
result, err := a.userBelongsToTeams(otherUserId, restrictions.Teams)
|
||||
result, err := a.Srv.Store.Team().UserBelongsToTeams(otherUserId, restrictions.Teams)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
@@ -2108,14 +2108,6 @@ func (a *App) UserCanSeeOtherUser(userId string, otherUserId string) (bool, *mod
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func (a *App) userBelongsToTeams(userId string, teamIds []string) (bool, *model.AppError) {
|
||||
result := <-a.Srv.Store.Team().UserBelongsToTeams(userId, teamIds)
|
||||
if result.Err != nil {
|
||||
return false, result.Err
|
||||
}
|
||||
return result.Data.(bool), nil
|
||||
}
|
||||
|
||||
func (a *App) userBelongsToChannels(userId string, channelIds []string) (bool, *model.AppError) {
|
||||
return a.Srv.Store.Channel().UserBelongsToChannels(userId, channelIds)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user