Loading TOC...

MarkLogic 10 Product Documentation
sec:get-distinct-permissions

sec:get-distinct-permissions(
   $input-perms as element(sec:permission)*,
   $output-perms as element(sec:permission)*
) as element(sec:permission)*

Summary

Returns a sequence of permission elements made up of a concatenation of $output-perms and the distinct permission elements of $input-perms.

Parameters
input-perms The input permissions.
output-perms The output permissions. This is typically an empty sequence.

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-distinct-permissions(
    (xdmp:permission("security", "read"), 
     xdmp:permission("security", "update")),
     ())
=>

<sec:permission xmlns:sec="http://marklogic.com/xdmp/security">
  <sec:capability>update</sec:capability>
  <sec:role-id>16363340809666818373</sec:role-id>
</sec:permission>
<sec:permission xmlns:sec="http://marklogic.com/xdmp/security">
  <sec:capability>read</sec:capability>
  <sec:role-id>16363340809666818373</sec:role-id>
</sec:permission>
   

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