MarkLogic 10 Product Documentation
sec.getRoleNames

sec.getRoleNames(
   role-ids as (Number|String)[]
) as Sequence

Summary

Returns sequence of unique sec:role-name's that corresponds to the sequence of role IDs $role-ids. Duplicate IDs return a single name.

Parameters
role-ids A sequence of role IDs.

Required Privileges

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

Usage Notes

If a role ID in $role-ids does not correspond to an existing role, an error is returned.

This function must be executed against the security database.

Example


// execute this against the security database
// There is no JSON output for this function.

const sec = require('/MarkLogic/security');

sec.getRoleNames(["6629014463670416824", "6615337390848046012"])    

=>

<sec:role-name xmlns:sec="http://marklogic.com/xdmp/security">editor</sec:role-name>
<sec:role-name xmlns:sec="http://marklogic.com/xdmp/security">writer</sec:role-name>  
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy