From bcef8eb910bdb4448704c6e1bbe2e875b0ee1908 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Mon, 19 Aug 2019 10:11:34 -0300 Subject: [PATCH] [BREAK] Remove publication `usersInRole` (#15194) --- app/authorization/server/index.js | 1 - .../server/publications/usersInRole.js | 27 ------------------- 2 files changed, 28 deletions(-) delete mode 100644 app/authorization/server/publications/usersInRole.js 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); -});