[MM-16330] Migrate "Channel.GetForPost" to Sync by default (#11199)

Этот коммит содержится в:
piperRyan
2019-06-19 02:27:09 -06:00
коммит произвёл Jesús Espino
родитель 209f70e80b
Коммит 5c32f92413
7 изменённых файлов: 48 добавлений и 39 удалений

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

@@ -75,8 +75,7 @@ func (a *App) SessionHasPermissionToChannelByPost(session model.Session, postId
}
}
if result := <-a.Srv.Store.Channel().GetForPost(postId); result.Err == nil {
channel := result.Data.(*model.Channel)
if channel, err := a.Srv.Store.Channel().GetForPost(postId); err == nil {
if channel.TeamId != "" {
return a.SessionHasPermissionToTeam(session, channel.TeamId, permission)
}
@@ -175,8 +174,7 @@ func (a *App) HasPermissionToChannelByPost(askingUserId string, postId string, p
}
}
if result := <-a.Srv.Store.Channel().GetForPost(postId); result.Err == nil {
channel := result.Data.(*model.Channel)
if channel, err := a.Srv.Store.Channel().GetForPost(postId); err == nil {
return a.HasPermissionToTeam(askingUserId, channel.TeamId, permission)
}