- replace deprecated command "ns_unlink" with native tcl command "file delete"
- update postgres function to modern style plpgsql definitions using dollar quoting
- fix collateral damage in upgrade scripts of file-storage
- fix $$ quoting in upgrade scripts
Using acs_permission__permission_p for checking persmissions instead of querying view acs_object_party_privilege_map (for PG >= 8.4).