Skip to content

Instantly share code, notes, and snippets.

@wolfgangmm
Created June 26, 2013 20:09
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wolfgangmm/5871157 to your computer and use it in GitHub Desktop.
Save wolfgangmm/5871157 to your computer and use it in GitHub Desktop.
Change group on all resources/collections in eXist-db root collection.
xquery version "3.0";
import module namespace dbutil="http://exist-db.org/xquery/dbutil" at "/db/apps/shared-resources/content/dbutils.xql";
let $root := "/db"
return
dbutil:scan(xs:anyURI($root), function($collection, $resource) {
if ($resource) then
sm:chgrp($resource, "biblio.users")
else
sm:chgrp($collection, "biblio.users")
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment