[Zope-dev] Proposal: Align Zope 2 and Zope 3 permissions
Dieter Maurer
dieter at handshake.de
Mon Apr 13 02:29:02 EDT 2009
Martin Aspeli wrote at 2009-4-12 18:31 +0800:
> ...
> 3) Change the Permission class in AccessControl so that it tries to
>look up an IPermission utility and use the title of that utility as the
>permission name, falling back on the current behaviour of using the
>passed permission name directly.
>
>Benefits: Should transparently allow any invocation of the Zope 2 API to
>use Zope 3 permission names, allowing us to document that the dotted
>permission name is the canonical name everywhere.
>
>Risks: Performance overhead of doing utility lookups. May result in name
>clashes, but since the permission name is a dotted name and the Zope 2
>permission name isn't, I think it's extremely unlikely that this would
>actually happen in practice.
You probably should be careful with this: if not done carefully, you
may end up doing the utility lookup not once but once at each object on the
path from the accessed object to the root.
--
Dieter
More information about the Zope-Dev
mailing list