Using acs_permission__permission_p for checking persmissions instead of querying view acs_object_party_privilege_map (for PG >= 8.4).