MarkLogic 10 Product Documentation
sec.getRoleIds

sec.getRoleIds(
   [role-names as String[]]
) as Sequence

Summary

Returns a sequence of unique sec:role-id elements that corresponds to the sequence of role names $role-names.

Duplicate names return a single ID.

If $role-names is omitted, returns all of the sec:role-id elements in the database.

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

Parameters
role-names A sequence of role names. If omitted, returns all of the sec:role-id elements in the database.

Required Privileges

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

Usage Notes

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.xqy');
   
sec.getRoleIds(("writer", "editor"))

=>

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