Meteor-Community-Packages / meteor-roles

Authorization package for Meteor, compatible with built-in accounts packages
http://meteor-community-packages.github.io/meteor-roles/
MIT License
921 stars 166 forks source link

Support for groups with parents #280

Closed antonio-goncalves-unp closed 4 years ago

antonio-goncalves-unp commented 5 years ago

There is any support for groups with parents? It would be useful for this use case

groupA: {name:"StoreA"} groupB: {name:"StoreB"} groupC: {name:"StoreCluster",children:["StoreA","StoreB"]}

Roles.addUsersToRoles(joesUserId, ['Manage'], 'StoreCluster');

Roles.userIsInRole(joesUserId, 'Manage', 'StoreA'); // true if considering parent groups Roles.userIsInRole(joesUserId, 'Manage', 'StoreB'); // true if considering parent groups

mitar commented 4 years ago

For which version is this? v1 or v2?

SimonSimCity commented 4 years ago

This functionality has already been added in 2.x, as far as I understand from the example. Please ask me to reopen if it's not applicable.