postgresql7.1 select acs_object__name(:object_id) select p.privilege, tree_level(h.tree_sortkey) as level from acs_privileges p left join acs_privilege_hierarchy_index h on p.privilege=h.privilege order by h.tree_sortkey select acs_permission__grant_permission(:object_id, :party_id, :privilege) select acs_permission__revoke_permission(:object_id, :party_id, :privilege)