0

When I try to include a permissions.zcml in my project, with this line on configure.zcml

 <include package="Products.CMFCore" file="permissions.zcml"
       xmlns:zcml="http://namespaces.zope.org/zcml"
       zcml:condition="have plone-41" />

or just this line

  <include package="Products.CMFCore"/ >

it fails to load and raises errors, when processing the rolemap.xml.

When I try to include the file with

<include file="permissions.zcml">

I get

ConfigurationError: ('Unknown directive', u'http://namespace.zope.org/zope', u'permission')

but when I write the permission declaration in configure.zcml it gets properly processed. I tried several include package statements. The dexterity manual states, that with zope 2.12 (using 2.13) collective.autopermission is no longer needed for this job.

What could I miss?

Edit I

my permissions.zcml

@Martijn Pieters: Zope version is: 2.13.16

moestly
  • 1,681
  • 15
  • 19
  • 1
    Could you include your full `permissions.zcml`? I think you are missing a namespace declaration. – Martijn Pieters Sep 30 '12 at 09:37
  • The `permission` directive is defined in the `AccessControl` `meta.zcml` file; not sure how your `zcml` file is being included without the `AccessControl` meta having been loaded. What Zope version is this? – Martijn Pieters Sep 30 '12 at 10:01

1 Answers1

0

I was indeed missing a namespace and and the include of AccessControl. This permissions.zcml does the job.

<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:meta="http://namespaces.zope.org/meta"
xmlns:browser="http://namespaces.zope.org/browser"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="dotted.name">

<includeDependencies package="." />
<include package="AccessControl" file="meta.zcml" />
<include package="Products.CMFCore" file="permissions.zcml"/>    

 </configure>
moestly
  • 1,681
  • 15
  • 19