carlos8f / node-relations

Entity relationship, role, and permissions API for Node.js
61 stars 20 forks source link

Adds `getRoles` function. #1

Closed erindethorne closed 11 years ago

erindethorne commented 11 years ago

In our use of node relations, we take advantage of dynamic roles to define a permissions schema where the role is really a Team id and all the subjects are members of that team. It would be useful for us to be able to access the in-memory definition of what roles map to a verb. For example, we may want to ask what team can execute an action, rather than asking who the subjects are.

This PR adds what seems like a pretty simply addition of a getRoles function, which returns a filtered list of all the roles in a context that map to a specified verb.

carlos8f commented 11 years ago

looks good, thanks!

carlos8f commented 11 years ago

published in v0.3.2