Loading TOC...

sec:get-role-ids

sec:get-role-ids(
   [$role-names as xs:string*]
) as element(sec:role-id)*

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 :)
xquery version "1.0-ml";
import module namespace sec="http://marklogic.com/xdmp/security" at 
   "/MarkLogic/security.xqy";
   
sec:get-role-ids(("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>

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