sec:get-privilege( $action as xs:string, $kind as xs:string ) as element(sec:privilege)?
Returns a sec:privilege element corresponding to a privilege identified by ($action,$kind). If no such privilege is found, an error is returned.
This function must be executed against the security database.
(: 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-privilege( "http://marklogic.com/xdmp/privileges/admin-module-read", "execute") => <sec:privilege xmlns:sec="http://marklogic.com/xdmp/security"> <sec:privilege-id>17293336516617295309</sec:privilege-id> <sec:privilege-name>admin-module-read</sec:privilege-name> <sec:action>http://marklogic.com/xdmp/privileges/admin-module-read</sec:action> <sec:role-ids> <sec:role-id>5444982746628127945</sec:role-id> <sec:role-id>6629014463670416824</sec:role-id> </sec:role-ids> <sec:kind>execute</sec:kind> </sec:privilege>
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.