From: Wolfgang M. <wol...@ex...> - 2011-10-18 12:28:07
|
Chris, a quick way of changing permissions on a collection tree would be to run a query like the following: xquery version "1.0"; declare function local:fix-permissions($collection, $permissions, $xqpermissions) { sm:chmod(xs:anyURI($collection), $permissions), for $resource in xmldb:get-child-resources($collection) return if (xmldb:get-mime-type(xs:anyURI((concat($collection, "/", $resource)))) eq "application/xquery") then sm:chmod(xs:anyURI(concat($collection, "/", $resource)), $xqpermissions) else sm:chmod(xs:anyURI(concat($collection, "/", $resource)), $permissions), for $child in xmldb:get-child-collections($collection) return local:fix-permissions(xs:anyURI(concat($collection, "/", $child)), $permissions, $xqpermissions) }; local:fix-permissions("/db", "rw-r--r--") But this doesn't solve the problem if you are constantly uploading new resources. I wonder how difficult it would be to re-enable the default collection permissions for now? I'll look at the corresponding revisions. Wolfgang |