Skip to content

Instantly share code, notes, and snippets.

@tuurma
Created July 16, 2018 20:03
Show Gist options
  • Save tuurma/261dba371c49478be60795c26019925a to your computer and use it in GitHub Desktop.
Save tuurma/261dba371c49478be60795c26019925a to your computer and use it in GitHub Desktop.
change owner, group an permissions for subcollections
xquery version "3.1";
declare function local:change-user($collection, $user, $group) {
if (xmldb:collection-available($collection)) then
(
for $child in xmldb:get-child-collections($collection)
let $path := concat($collection, '/', $child)
return
xmldb:set-collection-permissions($path, $user, $group, 493)
)
else
()
};
let $collection := '/db/apps/lgpn-data/data/persons'
return local:change-user($collection, 'lgpn', 'lgpn')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment