diff --git a/packages/rocketchat-channel-settings/client/views/channelSettings.js b/packages/rocketchat-channel-settings/client/views/channelSettings.js index d24806ba20b2c..fae55df84318e 100644 --- a/packages/rocketchat-channel-settings/client/views/channelSettings.js +++ b/packages/rocketchat-channel-settings/client/views/channelSettings.js @@ -50,6 +50,13 @@ Template.channelSettings.helpers({ } }); const roomType = room && room.t; + /* + dirty hack since custom permissions create in packages/assistify-help-request/startup/customRoomTypes.js + lead to a streamer exception in some occasions. + */ + if (roomType === 'e') { + return roomType && RocketChat.authz.hasAtLeastOnePermission('delete-c'); + } return roomType && RocketChat.authz.hasAtLeastOnePermission(`delete-${ roomType }`, this.rid); }, readOnly() { diff --git a/server/methods/eraseRoom.js b/server/methods/eraseRoom.js index f6501542a292c..dcde275333360 100644 --- a/server/methods/eraseRoom.js +++ b/server/methods/eraseRoom.js @@ -17,7 +17,12 @@ Meteor.methods({ }); } - if (RocketChat.authz.hasPermission(fromId, `delete-${ room.t }`, rid)) { + /* + dirty hack since custom permissions create in packages/assistify-help-request/startup/customRoomTypes.js + lead to a streamer exception in some occasions. + */ + if ((room.t === 'e' && RocketChat.authz.hasPermission(fromId, 'delete-c', rid)) || + RocketChat.authz.hasPermission(fromId, `delete-${ room.t }`, rid)) { RocketChat.models.Messages.removeByRoomId(rid); RocketChat.models.Subscriptions.removeByRoomId(rid); return RocketChat.models.Rooms.removeById(rid);