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/app/authorization/server/methods/removeRoleFromPermission.js

17 lines
569 B

import { Meteor } from 'meteor/meteor';
import { Permissions } from '../../../models';
import { hasPermission } from '../functions/hasPermission';
Meteor.methods({
'authorization:removeRoleFromPermission'(permission, role) {
if (!Meteor.userId() || !hasPermission(Meteor.userId(), 'access-permissions')) {
throw new Meteor.Error('error-action-not-allowed', 'Accessing permissions is not allowed', {
method: 'authorization:removeRoleFromPermission',
action: 'Accessing_permissions',
});
}
return Permissions.removeRole(permission, role);
},
});