[Zope3-Users] Permission problem on adapter

Dominique Lederer dominique.lederer at inode.at
Sat Feb 10 19:16:51 EST 2007


hi

i created a trusted adapter on a content object.
then i created a formlib edit page for the ZMI, to be able to edit the
new attributes on the adapted content object. the adapters interface is
correctly rendered to the form.

if i try to edit, an unauthorized error is shown, which i also get, when
i register the user as Site Manager via Grant in the ZMI.
The global admin *can* edit the adapters attributes (the one which is
set globally via ZCML).

i registered the adapter like this:
<adapter factory=".MyClassAnnotations"
         trusted="true"  />

<class class=".MyClassAnnotations" >
    <require
        permission="zope.View"
        interface=".interfaces.IMyClassAnnotations" />
    <require
        permission="zope.ManageContent"
        set_schema=".interfaces.IMyClassAnnotations" />
</class>

i can surpress the error, if i change the set_schema permission to
zope.View. But i think that is just a bad workarround.

what am i missing?
thank you for your help.

traceback is:

Module zope.formlib.form, line 757, in __call__
self.update()
Module zope.formlib.form, line 738, in update
result = action.success(data)
Module zope.formlib.form, line 582, in success
return self.success_handler(self.form, self, data)
Module zope.formlib.form, line 795, in handle_edit_action
if applyChanges(self.context, self.form_fields, data, self.adapters):
Module zope.formlib.form, line 509, in applyChanges
field.set(adapter, newvalue)
Module zope.schema._bootstrapfields, line 183, in set
setattr(object, self.__name__, value)
Unauthorized: (<pathto.MyClassAnnotations object at 0xa6e9ad2c>,
'headline', 'zope.ManageContent')


More information about the Zope3-users mailing list