[Zope3-Users] ForbiddenAttribute "add" error

Joseph Method tristil at gmail.com
Sat Mar 4 00:24:46 EST 2006


What kind of thing would go into an IContainerInterface?

Just to be sure, I added the <factory> directives, although they
seemed to be implied by the content directives, or I guess handled by
addMenuItem. No dice.

Fyi, here's the configure.zcml.


<content class=".debt.DebtManager">
        <factory

                id="debtman.debt.DebtManager"
                description="A debt manager"
        />

        <require
                permission="zope.ManageContent"
                interface=".interfaces.IDebtManager" />
        <require
                permission="zope.ManageContent"
                interface=".interfaces.IDebtManagerSchema" />

        <require
                permission="zope.ManageContent"
                set_schema=".interfaces.IDebtManagerSchema"
                />
        <require
                permission="zope.ManageContent"
                attributes="add"
                />
        <require like_class="zope.app.folder.Folder" />
  </content>

<content class=".debt.Claim">
        <factory
        id="debtman.debt.Claim"
        description="A Claim"
        />
        <require
                permission="zope.ManageContent"
                interface=".interfaces.IClaim" />
        <require
                permission="zope.ManageContent"
                set_schema=".interfaces.IClaim"/>
        <require like_class="zope.app.folder.Folder" />

</content>




On 3/3/06, baiju m <baiju.m.mail at gmail.com> wrote:
> On 3/4/06, Joseph Method <tristil at gmail.com> wrote:
> > Hi, I get this error
> >
> > ForbiddenAttribute: ('add', <zope.app.publisher.browser.viewmeta.+
> > object at 0x754d09ac>)
> >
> > when I try to add a "Claim" to a "DebtManager" (both are subclasses of
> > Folder) at http://localhost:8031/DebtManager/+/@@AddClaim.html
> >
> > The addform looks like this:
> >
> > <browser:addform
> >       schema="debtman.interfaces.IClaim"
> >       content_factory="debtman.debt.Claim"
> >       label="Add Claim"
> >       name="AddClaim.html"
> >       fields="title description debtor creditor amount"
> >       permission="zope.ManageContent"
> >       />
>
> You will required to give permission for 'IClaim' inteface.
>
> Something like::
>
>   <content class="debtman.debt.Claim">
>     <implements
>         interface="zope.app.annotation.interfaces.IAttributeAnnotatable"
>         />
>     <factory
>         id="debtman.debt.Claim"
>         description="A Claim."
>         />
>     <require
>         permission="zope.ManageContent"
>         interface="debtman.interfaces.IClaim"/>
>     <require
>         permission="zope.ManageContent"
>         set_schema="debtman.interfaces.IClaim"
>         />
>   </content>
>
> If you implemented a container interface (say, IClaimContainer)
> along with IClaim in debtman.debt.Claim, then you have add::
>
>     <require
>         permission="zope.ManageContent"
>         interface="debtman.interfaces.IClaimContainer"/>
>
> Regards,
> Baiju M
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
>


--
-J. Method


--
-J. Method


More information about the Zope3-users mailing list