v1.18.x
Barış Soner Uşaklı 8 years ago
parent 44353a2b39
commit e9f8cdc7f0

@ -15,21 +15,23 @@ module.exports = function (privileges) {
privileges.categories.list = function (cid, callback) { privileges.categories.list = function (cid, callback) {
// Method used in admin/category controller to show all users/groups with privs in that given cid // Method used in admin/category controller to show all users/groups with privs in that given cid
var privilegeLabels = privileges.privilegeLabels.slice();
var userPrivilegeList = privileges.userPrivilegeList.slice();
var groupPrivilegeList = privileges.groupPrivilegeList.slice();
async.waterfall([ async.waterfall([
function (next) { function (next) {
async.parallel({ async.parallel({
labels: function (next) { labels: function (next) {
async.parallel({ async.parallel({
users: async.apply(plugins.fireHook, 'filter:privileges.list_human', privileges.privilegeLabels), users: async.apply(plugins.fireHook, 'filter:privileges.list_human', privilegeLabels),
groups: async.apply(plugins.fireHook, 'filter:privileges.groups.list_human', privileges.privilegeLabels), groups: async.apply(plugins.fireHook, 'filter:privileges.groups.list_human', privilegeLabels),
}, next); }, next);
}, },
users: function (next) { users: function (next) {
var userPrivileges; var userPrivileges;
var memberSets; var memberSets;
async.waterfall([ async.waterfall([
async.apply(plugins.fireHook, 'filter:privileges.list', privileges.userPrivilegeList), async.apply(plugins.fireHook, 'filter:privileges.list', userPrivilegeList),
function (_privs, next) { function (_privs, next) {
userPrivileges = _privs; userPrivileges = _privs;
groups.getMembersOfGroups(userPrivileges.map(function (privilege) { groups.getMembersOfGroups(userPrivileges.map(function (privilege) {
@ -62,7 +64,7 @@ module.exports = function (privileges) {
groups: function (next) { groups: function (next) {
var groupPrivileges; var groupPrivileges;
async.waterfall([ async.waterfall([
async.apply(plugins.fireHook, 'filter:privileges.groups.list', privileges.groupPrivilegeList), async.apply(plugins.fireHook, 'filter:privileges.groups.list', groupPrivilegeList),
function (_privs, next) { function (_privs, next) {
groupPrivileges = _privs; groupPrivileges = _privs;
async.parallel({ async.parallel({

Loading…
Cancel
Save