Forum OpenACS Development: Re: Permissions question.

Collapse
2: Re: Permissions question. (response to 1)
Posted by Dave Bauer on
Use this in the WHERE clause

select 1 from dual
where exists
( select 1 from acs_object_party_privilege_map ppm
where ppm.object_id = :object_id and ppm.party_id = :party_id and ppm.privilege = :privilege )

acs_object_party_privilege_map is a view that takes care of everything.
Using a plpgsql function in the where clause causes the function to be called for EVERY ROW. If you are joining on acs_objects to check permissions this will be quite slow.