postgresql7.1 select o.object_id, acs_object__name(o.object_id) as name from acs_objects o, acs_object_party_privilege_map map where map.object_id = o.object_id and map.party_id = :user_id and map.privilege = 'admin'