[Zope-CMF] Customised permissions

Charlie Clark charlie at begeistert.org
Wed Jun 3 10:56:13 EDT 2009


Am 03.06.2009 um 15:47 schrieb Martin Aspeli:

> That code is, but not the whole functionality. The functionality to
> register Zope 2 style permissions when a <permission /> ZCML statement
> is used is new to collectie.autopermission. I merged that back into  
> Zope
> for Zope 2.12, so if you're on 2.12 you're in luck. :)

er, coughs, goes red - still on 2.10 for this project but there is a  
chance we might update. Main difference would be the add views which  
are all based on yuppie's CMF 2.1+ stuff which has since changed.

>> It looks like I only need use_mailhost_services which I've hooked up
>> in like this
>>
>> security = ModuleSecurityInfo('Products.CMFCore.permissions') <-
>> should this reflect my module?
>>
>> security.declarePublic('UseMailHostServices')
>> UseMailHostServices = Permissions.use_mailhost_services
>>
>> in a dedicated permissions module which I just include in the
>> configuration. Although I do like the event handling. Wouldn't it be
>> an idea to put this actually in the CMF?
>
> The point is that Zope 2 permissions spring into existence when you
> start using them in a Module/ClassSecurityInfo. If nothing imports a
> module that has one of those, your permission doesn't exist. Prior to
> Zope 2.12, the <permission /> directive only used to map Zope 2
> permissions to IPermission utilities, but not actually create new  
> ones.

Thanks for the explanation. So without the event handler I need to  
register the permission manually? That would explain what we're  
observing.

>> I also noticed that the CMF permissions are actually declared in  
>> Five.
>> Is there a reason for this? Surely the CMF permission declarations
>> should be in CMFCore
>
> Sure. Historical reasons.


Can't argue with them! ;-)

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226





More information about the Zope-CMF mailing list