[Grok-dev] Security declarations

Martijn Faassen faassen at startifact.com
Fri Oct 9 11:32:21 EDT 2009


Hey,

Marc Rijken wrote:
> Thanx for your prompt reply. I have tried is in grok0.14. I did not get 
> any errors, but it did not work. When I changed the classes in to 
> strings it did work. I have moved the code to grok1.0 and it works as 
> expected. I'm not sure that was the only difference.
> 
> BTW this behaviour is not document on 
> http://grok.zope.org/doc/current/reference/directives.html#security-directives 
> which states  " permission – the name of the permission that is required"

Thanks, that's indeed a documentation bug.

I've updated the documentation to reflect this now in SVN. One question 
is whether this really works with Role. I couldn't find a test that 
tests this, so that's a testing issue at least. I tried adjusting a test 
to try it out, but I got errors in my test run.

This implies that the documentation in SVN is now ahead of the code. 
Could someone add a test that tests direct permission references in 
grok.Role?

This ought to work:

class MyPermission(grok.Permission):
     ...

class MyPermissions2(grok.Permission):
     ...

class Foo(grok.Role):
     ...
     grok.permissions(MyPermission, MyPermission2)

Thanks, brave test-adder. :)

Regards,

Martijn



More information about the Grok-dev mailing list