sec.getRoleNames( role-ids as (Number|String)[] ) as Sequence
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. |
http://marklogic.com/xdmp/privileges/get-role-names
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.
(: execute this against the security database :) 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>