Created
December 22, 2016 22:41
-
-
Save tternquist/12e5f482a32d70dbe1df796262fc4eda to your computer and use it in GitHub Desktop.
Get role name and permissions for MarkLogic document
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import module namespace sec="http://marklogic.com/xdmp/security" at | |
"/MarkLogic/security.xqy"; | |
declare function local:document-get-permissions($uri) { | |
xdmp:document-get-permissions($uri) ! | |
xdmp:invoke-function(function() { | |
element role {., | |
sec:get-role-names(xs:unsignedLong(.//sec: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