[BREAK] Remove publication `usersInRole` (#15194)

pull/15198/head
Diego Sampaio 6 years ago committed by GitHub
parent 8ef6dc59b0
commit bcef8eb910
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      app/authorization/server/index.js
  2. 27
      app/authorization/server/publications/usersInRole.js

@ -22,7 +22,6 @@ import './methods/removeUserFromRole';
import './methods/saveRole';
import './publications/permissions';
import './publications/roles';
import './publications/usersInRole';
import './startup';
export {

@ -1,27 +0,0 @@
import { Meteor } from 'meteor/meteor';
import { hasPermission } from '../functions/hasPermission';
import { getUsersInRole } from '../functions/getUsersInRole';
Meteor.publish('usersInRole', function(roleName, scope, limit = 50) {
console.warn('The publication "usersInRole" is deprecated and will be removed after version v2.0.0');
if (!this.userId) {
return this.ready();
}
if (!hasPermission(this.userId, 'access-permissions')) {
return this.error(new Meteor.Error('error-not-allowed', 'Not allowed', {
publish: 'usersInRole',
}));
}
const options = {
limit,
sort: {
name: 1,
},
};
return getUsersInRole(roleName, scope, options);
});
Loading…
Cancel
Save