[Grok-dev] Re: grok.define_role

Philipp von Weitershausen philipp at weitershausen.de
Thu Aug 2 03:33:52 EDT 2007

Jan-Wijbrand Kolman wrote:
> I'm neutral on the module-level directive versus class definition, but
> I would like to see defining permissions and defining roles to be
> spelled in a similar manner. Would it make sense then to rather see
> grok.define_role deprecated and have:
>   class MyPermissionName(grok.Permission):
>       grok.name('My Nice Permission Name')

Yes, I'd say so. Note that the *name* (=id) of a permission should be a 
dotted name (e.g. 'my.NicePermission') while the *title* should be a 
text explaining what it is (e.g. "A nice permission"):

   class NicePermission(grok.Permission):
       grok.title('A nice permission')

http://worldcookery.com -- Professional Zope documentation and training

More information about the Grok-dev mailing list