[Grok-dev] HEADS UP: grok.define_permission gone in favor of
grok.Permission
Jan-Wijbrand Kolman
janwijbrand at gmail.com
Wed Aug 22 09:19:08 EDT 2007
Hi,
This is an important heads up!
As has been discussed before
(http://thread.gmane.org/gmane.comp.web.zope.grok.devel/1637/) the
define_permission is now gone in favor of the grok.Permission component
base class.
So, from now on, instead of:
grok.define_permission('grok.NicePermission')
you do:
class NicePermission(grok.Permission):
grok.name('grok.NicePermission')
grok.title('Title for Nice Permission') # optional
As an added bonus (and the reason for this refactoring) there's now an
easy way to define roles:
class NiceRole(grok.Role):
grok.name('grok.NiceRole')
grok.title('Title for Role') # optional
# multiple permissions ids allowed here
grok.permissions('grok.NicePermission', ...)
Writing this post reminds me of updating CHANGES.txt - I will do so
rightaway...
kind regards,
jw
More information about the Grok-dev
mailing list