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

19 lines
568 B

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