Portal action available_expr and security restrictions

Wichert Akkerman wichert at wiggy.net
Mon Aug 13 08:14:28 UTC 2007

Previously Derek Richardson wrote:
> Wichert Akkerman wrote:
> >Previously Derek Richardson wrote:
> >>So, I need to have a portal action that queries for an adapter and gets a 
> >>utility in its available_expr. Can't do that in an expr, it seems. Tried 
> >>module['zope.component'].getUtility(...), but security error.
> >
> >module['Products.CMFCore.utils'].getUtilityByInterfaceName
> While I struggle with getting this to work through the security 
> infrastructure, can I ask if there is a similar one-liner for querying an 
> adapter from restricted code? I read through Products.CMFCore.utils and 
> didn't see one...

Not that I'm aware of. Instead of doing complex work in available_expr
why not use a z3 view and call that from available_expr?


Wichert Akkerman <wichert at wiggy.net>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.

More information about the Product-Developers mailing list