sec.getPrivilege( action as String, kind as 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 // There is no JSON output for this function. const sec = require('/MarkLogic/security.xqy'); sec.getPrivilege( "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.