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
920 stars 164 forks source link

Get only parent roles. #301

Closed danyhiol closed 4 years ago

danyhiol commented 4 years ago

Is there any function to get only user's parent roles? Something like Roles.getAllParentRoles(userId);

SimonSimCity commented 4 years ago

What you mean by parent roles?

In case you mean the roles assigned to a user, you can use: Roles.getRolesForUser(user, { onlyAssigned: true })

https://github.com/Meteor-Community-Packages/meteor-roles/blob/master/roles/roles_common.js#L710

danyhiol commented 4 years ago

Exactly what I was looking for. Thanks.