Forum OpenACS Development: Re: Permissions question.

Collapse
3: Re: Permissions question. (response to 1)
Posted by Jorge Couchet on
Dave, thanks!!.

A doubt (only by curiosity): why the query from the PL/SQL function is different from the query of the TCL function (I assume that they do the same)?

Thanks again.

Jorge.

Collapse
4: Re: Permissions question. (response to 3)
Posted by Tom Jackson on
You should probably look at the view definition for acs_object_party_privilege_map. It might just be that the second query represents the view. In general it is better to replace well used joins with a view so they are easier to read and reuse, and so that you avoid confusion and/or bugs. In postgres, views are still handled like the original def for query planning, but maybe the setup is faster, which would be another benefit.

If there is a pl function which does a permission_p check, this should be optimized and then used by the Tcl proc directly. However, if you are looking for a permission as part of a where clause, the view (map) should be used for the reasons Dave gave above, this allows the query planner/optimizer to speed things up.

Collapse
5: Re: Permissions question. (response to 4)
Posted by Jorge Couchet on
Tom,

Thanks a lot!.

Indeed, tracking the view, the second query represents it.

Jorge.