Forum OpenACS Development: Re: Permission system in needs of revisit?

Collapse
Posted by Gustaf Neumann on
The array permission__permission_p__cache just prevents that - during a single request - the same permission is only looked-up once from the database. This double-lookup-prevention happens no matter what other caching options are used. I think, this is a sensible behavior. Yes, the array is deleted in the thread after the request.

There is a small bug in permission::permission_p_not_cached: the unused non-positiional argument "-no_cache" should be most probably removed.

Collapse
Posted by Malte Sussdorff on
Yes, this lookup prevention is great, which is why I would put it outside the "not_cached" version and put it into permission::permission_p, because otherwise we hit the util_memoize cache more often than we need to. And my assumption is that the util_memoize lookup is slower than going for the array.

In my understanding the first thing permission::permission_p should do is to look up the array and if it finds an entry return that value, skipping all other checks and procedure calls. Does this make sense ?