diff --git a/app/authorization/server/index.js b/app/authorization/server/index.js index 37a853a1f10..01ac6e9e807 100644 --- a/app/authorization/server/index.js +++ b/app/authorization/server/index.js @@ -22,7 +22,6 @@ import './methods/removeUserFromRole'; import './methods/saveRole'; import './publications/permissions'; import './publications/roles'; -import './publications/usersInRole'; import './startup'; export { diff --git a/app/authorization/server/publications/usersInRole.js b/app/authorization/server/publications/usersInRole.js deleted file mode 100644 index f7eb22146e4..00000000000 --- a/app/authorization/server/publications/usersInRole.js +++ /dev/null @@ -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); -});