Skip to content

Instantly share code, notes, and snippets.

@eouthwaite
Created September 25, 2019 14:23
Show Gist options
  • Save eouthwaite/4bb3eb41ad340728bb15cef9ce49abe5 to your computer and use it in GitHub Desktop.
Save eouthwaite/4bb3eb41ad340728bb15cef9ce49abe5 to your computer and use it in GitHub Desktop.
xdmp:role-name is available in ML10 and so useful I need to replicate in 8 and 9...
xquery version "1.0-ml";
import module namespace sec="http://marklogic.com/xdmp/security" at "/MarkLogic/security.xqy";
declare function local:role-name(
$role-id as xs:unsignedLong
) as xs:string {
xdmp:invoke-function(
function() { sec:get-role-names($role-id) },
<options xmlns="xdmp:eval">
<database>{xdmp:database("Security")}</database>
</options>
)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment