Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Check for mention-all permission in room scope #8931

Merged
merged 1 commit into from
Dec 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/rocketchat-lib/server/methods/filterATAllTag.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ RocketChat.callbacks.add('beforeSaveMessage', function(message) {
if (message.mentions != null &&
_.pluck(message.mentions, '_id').some((item) => item === 'all')) {

// Check if the user has permissions to use @all.
if (!RocketChat.authz.hasPermission(message.u._id, 'mention-all')) {
// Check if the user has permissions to use @all in both global and room scopes.
if (!RocketChat.authz.hasPermission(message.u._id, 'mention-all') && !RocketChat.authz.hasPermission(message.u._id, 'mention-all', message.rid)) {

// Get the language of the user for the error notification.
const language = RocketChat.models.Users.findOneById(message.u._id).language;
Expand Down