[MM-21919] Add use_channel_mentions permission (#13781)
* MM-21919 Add channel_mention permission * MM-21919 Fix emojis migration test * Enforce Channel Mentions on the in the posts api * MM-21919 Rename permission to use_channel_mentions Allow posts with channel mentions to still be posted without the permission just don't send notifications to users * MM-21919 Add tests for a post with @all and @here * MM-21919 Add use channel mentions to all roles that have create post * MM-21919 Update app_test to include use_channel_mentions permission in default permissions
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
a7854f1b97
Коммит
897715f883
@@ -624,6 +624,10 @@ func getMentionsEnabledFields(post *model.Post) model.StringArray {
|
||||
|
||||
// allowChannelMentions returns whether or not the channel mentions are allowed for the given post.
|
||||
func (a *App) allowChannelMentions(post *model.Post, numProfiles int) bool {
|
||||
if !a.HasPermissionToChannel(post.UserId, post.ChannelId, model.PERMISSION_USE_CHANNEL_MENTIONS) {
|
||||
return false
|
||||
}
|
||||
|
||||
if post.Type == model.POST_HEADER_CHANGE || post.Type == model.POST_PURPOSE_CHANGE {
|
||||
return false
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user