[Grok-dev] megrok.menu outdated ??
Leonardo Rochael Almeida
leorochael at gmail.com
Fri Dec 12 07:27:35 EST 2008
Hi Santiago,
I believe you should always commit your code.
It's ok to be unsure whether your code is correct and want someone to
review it before commiting it to the trunk. In this case I sugest you
commit it to a branch to give others the opportunity to review it.
Cheers, Leo
On Fri, Dec 12, 2008 at 01:31, Santiago Videla
<santiago.videla at gmail.com> wrote:
> 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
>
>
> [...]
More information about the Grok-dev
mailing list