Hi,
I'm studying the permission system, and I have a doubt related with the forum post: https://openacs.org/forums/message-view?message_id=111076
There appears the following (from Don Baccus): "Right which is why I keep telling people that with the new permissions system, don't call permission_p in your where clause but use the acs_object_party_privilege_map (or whatever it's called) with an "exists" subselect instead".
Well, my doubts are:
1) That advice continues applying?
2) I was watching the source code of: permission::permision_p (from the TCL API), and acs_permission__permission_p (from the PL/SQL API):
- the first executes the query:
***********
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 )
***********
- the second executes the query:
***********
return exists (select 1
8 from acs_permissions p, party_approved_member_map m,
9 acs_object_context_index c, acs_privilege_descendant_map h
10 where p.object_id = c.ancestor_id
11 and h.descendant = permission_p__privilege
12 and c.object_id = permission_p__object_id
13 and m.member_id = permission_p__party_id
14 and p.privilege = h.privilege
15 and p.grantee_id = m.party_id)
***********
Why the functions's queries are different?, and which I should use?
Thanks a lot for the help!
Jorge.