Skip to content

Instantly share code, notes, and snippets.

@grechaw
Created July 7, 2014 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grechaw/ef039422a5f1966e67df to your computer and use it in GitHub Desktop.
Save grechaw/ef039422a5f1966e67df to your computer and use it in GitHub Desktop.
Set accepted questions permissions
xquery version "1.0-ml";
for $d in cts:search(collection(), cts:directory-query("/questions/"))
where $d/answers/accepted[.=true()]
return xdmp:document-add-permissions( $d/base-uri() , xdmp:permission("samplestack-guest", "read"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment