Loading TOC...

trgr:trigger-get-permissions

trgr:trigger-get-permissions(
   $trigger-name as xs:string
) as element(sec:permission)*

Summary

Returns the permissions for the named trigger.

Parameters
trigger-name The trigger name.

Usage Notes

The permissions on a trigger determine which roles may modify the trigger. This function must be run in the context of the database containing the trigger to be examined.

If the named trigger does not exist, the exception TRGR-TRIGGERDNE is raised.

Example

xquery version "1.0-ml";
import module namespace trgr="http://marklogic.com/xdmp/triggers" 
   at "/MarkLogic/triggers.xqy";

(: Run in the context of the database containing the trigger :)
trgr:trigger-get-permissions("myTrigger")

  => <sec:permission xmlns:sec="http://marklogic.com/xdmp/security">
       <sec:capability>update</sec:capability>
       <sec:role-id>6991745490888355329</sec:role-id>
     </sec:permission>
     <sec:permission xmlns:sec="http://marklogic.com/xdmp/security">
       <sec:capability>read</sec:capability>
       <sec:role-id>6991745490888355329</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.