The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rocket.Chat/server/startup/migrations/v038.js

16 lines
527 B

RocketChat.Migrations.add({
version: 38,
up() {
if (RocketChat && RocketChat.settings && RocketChat.settings.get) {
const allowPinning = RocketChat.settings.get('Message_AllowPinningByAnyone');
// If public pinning was allowed, add pinning permissions to 'users', else leave it to 'owners' and 'moderators'
if (allowPinning) {
if (RocketChat.models && RocketChat.models.Permissions) {
RocketChat.models.Permissions.update({ _id: 'pin-message' }, { $addToSet: { roles: 'user' } });
}
}
}
},
});