diff --git a/packages/rocketchat-message-pin/server/pinMessage.js b/packages/rocketchat-message-pin/server/pinMessage.js index f5d64328c039..32e912a9d215 100644 --- a/packages/rocketchat-message-pin/server/pinMessage.js +++ b/packages/rocketchat-message-pin/server/pinMessage.js @@ -37,7 +37,7 @@ Meteor.methods({ }); } - if (!RocketChat.authz.hasPermission(Meteor.userId(), 'pin-message')) { + if (!RocketChat.authz.hasPermission(Meteor.userId(), 'pin-message', message.rid)) { throw new Meteor.Error('not-authorized', 'Not Authorized', { method: 'pinMessage' }); } @@ -119,7 +119,7 @@ Meteor.methods({ }); } - if (!RocketChat.authz.hasPermission(Meteor.userId(), 'pin-message')) { + if (!RocketChat.authz.hasPermission(Meteor.userId(), 'pin-message', message.rid)) { throw new Meteor.Error('not-authorized', 'Not Authorized', { method: 'pinMessage' }); }