|
View:
New views
9 Messages
—
Rating Filter:
Alert me
|
|
|
Security declarationsHi,
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@... https://mail.zope.org/mailman/listinfo/grok-dev |
||||||||
|
|
Re: Security declarationsHey,
Marc Rijken wrote: > 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. > > 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? Have you tried this? I thought we had this feature already, at least in grok.View. I'm not sure whether it also works for grok.Role. If not, that we should add this. Regards, Martijn _______________________________________________ Grok-dev mailing list Grok-dev@... https://mail.zope.org/mailman/listinfo/grok-dev |
||||||||
|
|
Re: Security declarationsIt's already working this way, that's the way I use it :)
2009/10/9 Marc Rijken <marc@...>: > 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@... > https://mail.zope.org/mailman/listinfo/grok-dev > Grok-dev mailing list Grok-dev@... https://mail.zope.org/mailman/listinfo/grok-dev |
||||||||
|
|
Re: Security declarationsSouheil CHELFOUH wrote:
> It's already working this way, that's the way I use it :) Does it work that way for Role too? I wasn't sure where in the code I should be looking. :) Regards, Martijn _______________________________________________ Grok-dev mailing list Grok-dev@... https://mail.zope.org/mailman/listinfo/grok-dev |
||||||||
|
|
|
| Onderwerp: | Re: [Grok-dev] Security declarations |
|---|---|
| Datum: | Fri, 09 Oct 2009 16:59:28 +0200 |
| Van: | Marc Rijken marc@... |
| Aan: | Martijn Faassen faassen@... |
Hey, Marc Rijken wrote: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.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?Have you tried this? I thought we had this feature already, at least in grok.View. I'm not sure whether it also works for grok.Role. If not, that we should add this. Regards, Martijn _______________________________________________ Grok-dev mailing list Grok-dev@... https://mail.zope.org/mailman/listinfo/grok-dev
| Free embeddable forum powered by Nabble | Forum Help |