[Grok-dev] Security declarations

Souheil CHELFOUH trollfot at gmail.com
Fri Oct 9 10:28:39 EDT 2009


It's already working this way, that's the way I use it :)

2009/10/9 Marc Rijken <marc at rijken.org>:
> Hi,
>
> In the security declarations we have to use the name of the permission.
> For me it is more logical and less error sensitive when the string may
> be replaced by the class.
>
> The current situation is:
>
> class FooPermssion(grok.Permission):
>     grok.name('foo.permission')
>     grok.title('Foo Permission')
>
> class FooRole(grok.Role):
>     grok.name('foo.Role')
>     grok.title('Foo Role')
>     grok.permissions(
>         'foo.permission', # string
>         )
>
> class FooView(grok.View):
>     grok.name('index.html')
>     grok.require('foo.permission') # string
>
> My preferred situation is:
>
> class FooPermssion(grok.Permission):
>     grok.name('foo.permission')
>     grok.title('Foo Permission')
>
> class FooRole(grok.Role):
>     grok.name('foo.Role')
>     grok.title('Foo Role')
>     grok.permissions(
>         FooPermission,  # class instead of string
>         )
>
> class FooView(grok.View):
>     grok.name('index.html')
>     grok.require(FooPermission) # class instead of string
>
> What do you think?
>
> Regards,
>
> Marc
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev
>


More information about the Grok-dev mailing list