[Grok-dev] Re: Recipe for "egg-like" reuse?
sebastian at urbantalk.se
Wed Apr 9 08:37:17 EDT 2008
9 apr 2008 kl. 14.29 skrev Uli Fouquet:
> You shouldn't have to fiddle with ZCML files for this. That's what
> is for. Including the package as shown above should be sufficient.
> forget to rerun buildout afterwards.
I went all in and fiddled everywhere... :) I got the hint to update
configure.zcml by looking at how the grok admin interface was
registered, but I realised that it was probably the wrong way.
>> in configure.zcml. I have reverted to your suggestion and it works
>> equally well. Now I am only struggling to get the grok.Permissions to
>> work again. I have defined:
>> class ViewContacts(grok.Permission):
>> But I still get the error "Undefined permission
> Did you define the permission in the protoncms package? In the same
> module where you use 'grok.require('protoncms.EditUser')? Does the
> failure show up at startup? I must confess, I get a bit confused here.
I defined the permission 'my.perm' in app.py of the protoncms package.
The error shows up during startup when I add a
grok.requires('my.perm') to a view in the protoncms package, claiming
that I haven't defined the permission. I have double and tripple
checked the spelling. And the code did work prior to refactoring.
jhsware$ parts/app/runzope -C parts/zopectl/zope.conf
Traceback (most recent call last):
File "parts/app/runzope", line 112, in ?
zope.app.twisted-3.4.0a1-py2.4.egg/zope/app/twisted/main.py", line 74,
145, in setup
py2.4.egg/zope/app/appsetup/appsetup.py", line 111, in config
context = xmlconfig.file(file, context=context, execute=execute)
line 612, in file
610, in execute_actions
py2.4.egg/grok/util.py", line 43, in make_checker
py2.4.egg/grok/util.py", line 59, in check_permission
martian.error.GrokError: Undefined permission 'protoncms.EditUser' in
<class 'protoncms.protonuser.Edit'>. Use grok.Permission first.
configure.zcml", line 4.2-4.27
<grok:grok package="." />
> Kind regards,
More information about the Grok-dev