MarkLogic 10 Product Documentation
sec.roleGetRoles

sec.roleGetRoles(
   role-name as String
) as Sequence

Summary

Returns a sequence of role names for the roles directly assigned to the given role ($role-name).

Parameters
role-name The name of a role.

Required Privileges

http://marklogic.com/xdmp/privileges/role-get-roles

Usage Notes

If a role with name equal to $role-name is not found, an error is returned.

If a role is assigned to itself, the sequence returned from sec:role-get-roles does not include itself.

To find all of the roles this role inherits (that is, the roles assigned directly to this role, the roles assigned to those roles, and so on), use the xdmp:role-roles built-in function.

This function must be executed against the security database.

Example


// execute this against the security database
  
const sec = require('/MarkLogic/security.xqy');
   
sec.roleGetRoles("Developer")

=>

filesystem-access
pipeline-execution
   
Powered by MarkLogic Server | Terms of Use | Privacy Policy