[MM-45272] Fix MM-45272 (#24701)
* Fix MM-45272 * Properly handle permalinks * Fix * Fix tests * Handle only not found case for team member * Fix lint * Use proper config value * Separate permission in several statements * Add tests * Fix lint * Revert changes on utils * Address feedback and more fixes * Address feedback * Fix test * Fix test and related bug * Fix and reorder test * Address feedback * Address feedback --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c395ec6245
Коммит
2ff0fe343e
@@ -380,5 +380,13 @@ func (a *App) HasPermissionToReadChannel(c request.CTX, userID string, channel *
|
||||
if !*a.Config().TeamSettings.ExperimentalViewArchivedChannels && channel.DeleteAt != 0 {
|
||||
return false
|
||||
}
|
||||
return a.HasPermissionToChannel(c, userID, channel.Id, model.PermissionReadChannelContent) || (channel.Type == model.ChannelTypeOpen && a.HasPermissionToTeam(c, userID, channel.TeamId, model.PermissionReadPublicChannel))
|
||||
if a.HasPermissionToChannel(c, userID, channel.Id, model.PermissionReadChannelContent) {
|
||||
return true
|
||||
}
|
||||
|
||||
if channel.Type == model.ChannelTypeOpen && !*a.Config().ComplianceSettings.Enable {
|
||||
return a.HasPermissionToTeam(c, userID, channel.TeamId, model.PermissionReadPublicChannel)
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user