From: Chris T. <chr...@gm...> - 2011-10-18 13:29:33
|
Wolfgang, Thanks. I'd also written a q:repair-permissions() since I had this issue for a while. I'll compare with yours - which is likely better. Chris On Oct 18, 2011, at 6:12 PM, Wolfgang Meier wrote: > 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 |