[MM-58492][MM-58523] Fixed some access control bugs around archived channels by replacing the permission check with HasPermissionToReadChannel (#27409)
* [MM-58492][MM-58523] Fixed some access control bugs around archived channels by replacing the permission check with HasPermissionToReadChannel * Fix lint, add ChannelId to uploads * Fix MMCTL tests and remove unnecessary check for the error message that doesn't work anyways * Include channel map for getting flagged posts --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6ddf796384
Коммит
aa85a13c8f
@@ -2087,7 +2087,7 @@ func (a *App) GetPostIfAuthorized(c request.CTX, postID string, session *model.S
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !a.SessionHasPermissionToChannel(c, *session, channel.Id, model.PermissionReadChannelContent) {
|
||||
if !a.SessionHasPermissionToReadChannel(c, *session, channel) {
|
||||
if channel.Type == model.ChannelTypeOpen && !*a.Config().ComplianceSettings.Enable {
|
||||
if !a.SessionHasPermissionToTeam(*session, channel.TeamId, model.PermissionReadPublicChannel) {
|
||||
return nil, model.MakePermissionError(session, []*model.Permission{model.PermissionReadPublicChannel})
|
||||
|
||||
Ссылка в новой задаче
Block a user