Add a stub to register role resolvers
This commit is contained in:
parent
660ef89755
commit
be32341467
|
@ -137,6 +137,17 @@ Role.RELATED = "$related"; // any User with a relationship to the object
|
|||
Role.AUTHENTICATED = "$authenticated"; // authenticated user
|
||||
Role.EVERYONE = "$everyone"; // everyone
|
||||
|
||||
/**
|
||||
* Add custom handler for roles
|
||||
* @param role
|
||||
* @param resolver The resolver function decides if a principal is in the role dynamically
|
||||
*
|
||||
* isInRole(role, context, callback)
|
||||
*/
|
||||
Role.registerResolver = function(role, resolver) {
|
||||
Role.resolvers[role] = resolver;
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if a given principal is in the role
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue