Loading TOC...

MarkLogic 9 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 :)
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>  
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.