sec.getDistinctPermissions( input-perms as element(sec.permission)[], output-perms as element(sec.permission)[] ) as Sequence
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. |
This function must be executed against the security database.
// execute this against the security database declareUpdate(); const sec = require('/MarkLogic/security.xqy'); sec.getDistinctPermissions( [xdmp.permission("security", "read","element"), xdmp.permission("security", "update","element")], []) => <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>