[Grok-dev] megrok.menu outdated ??

Santiago Videla santiago.videla at gmail.com
Thu Dec 11 22:31:38 EST 2008


Hey,


> I assume that the 'execute' method's signature has changed. Please feel
> free to fix this in svn.zope.org. I'm no longer maintaining megrok.menu
> myself.
>

thanks, I have write access to svn.zope.org since today :)

I have been working on this, but I would like some feedback before commit
changes. Actually, I already sent the import fix.
But now I want to be sure about what I'm doing. It's my first time coding
inside grokkers

I guess that megrok.menu was released before, grokcore.* (grokcore.view,
grokcore.security). So, I made these changes

MenuItemGrokker now inherits from ViewSecurityGrokker instead of
ViewGrokker. I understand that ViewSecurityGrokker adds the permission
directive. am I right?

By doing this, I had to modify the 'execute' signature of MenuItemGrokker.

I also changed the 'callable' parameter on the config.action() call. Instead
of use 'protectName' from zope.app.security.protectclass,
I'm using 'protect_getattr' from grokcore.security.util

And the last thing it's the 'discriminator'. I'm far away to understand how
this works ... :(
but using 'protectName' I got this traceback

zope.configuration.config.ConfigurationConflictError: Conflicting
configuration actions
  For: ('protectName', <class 'sample.app.Item1'>, 'browserDefault')
    File "/home/sancho/sample/src/sample/configure.zcml", line 7.2-7.27
        <grok:grok package="." />
    File "/home/sancho/sample/src/sample/configure.zcml", line 7.2-7.27
        <grok:grok package="." />
  For: ('protectName', <class 'sample.app.Item1'>, 'publishTraverse')
    File "/home/sancho/sample/src/sample/configure.zcml", line 7.2-7.27
        <grok:grok package="." />
    File "/home/sancho/sample/src/sample/configure.zcml", line 7.2-7.27
        <grok:grok package="." />


After some hours (sailing in the source code of zope and grok), I found that
the ViewSecurityGrokker it's using the same 'discriminator', so I changed to
'protectMenuName' and it works. But as I said, I don't understand that
means, or if I'm doing something wrong.

The thing is that now, megrok.menu it's working with Grok 0.14 and it pass
all the automated tests

I'm not sure if I should commit these changes without understand what I'm
doing... you tell me :)

Regards


-- 
Santiago Videla
www.revolucionesweb.com.ar
http://www.linkedin.com/in/svidela

Sigue la mata dando de que hablar siempre abajo y a la izquierda donde el
pensamiento que se hace corazón resplandece con la palabra sencilla y
humilde que l at s tod at s somos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/grok-dev/attachments/20081212/721ccd06/attachment.html 


More information about the Grok-dev mailing list