[Zope3-Users] 403 error upon using addform

Florian Lindner mailinglists at xgm.de
Tue Nov 16 02:49:52 EST 2004


Stephan Richter schrieb:
> On Sunday 14 November 2004 11:11, Florian Lindner wrote:
> 
>>But when I fill in the id input field in the form and submit I just get
>>a Unauthorized (403) error message, also I am logged in as a manager.

One addition: It's exactly the same behavior when I'm not logged in 
(working as anonymous).

> Can you provide the traceback? Just because you are a manager, you cannot do 
> everything. If a particular attribute has no security declaration, it is 
> accessible by noone.

I haven't translated it, but I'm sure you know what the fields are:

Zeit: Tue Nov 16 11:41:50 2004
Benutzer: florian, zope.manager, Manager,
Anfrage-URL: 
http://localhost:8080/++skin++centershock/eventfolder/+/AddCSEvent.html%3Dabc
Ausnahmetyp: Unauthorized
Ausnahmewert: ('browserDefault', 'zope.Public')

Zurückverfolgung:

Traceback (innermost last):

* Module zope.publisher.publish, line 135, in publish
   object = request.traverse(object)
* Module zope.publisher.browser, line 507, in traverse
   ob, add_steps = publication.getDefaultTraversal(self, ob)
* Module zope.app.publication.browser, line 52, in getDefaultTraversal
   return ob.browserDefault(request)

Unauthorized: ('browserDefault', 'zope.Public')


>>Another questions is why there is only one field although the schema at
>>CS.interfaces.IEvent definied some other fields? 
> 
> 
> This is strange. Did you setup something incorreclty?

Probably... But what?

>>The ZCML reference says: 
>>
>>"The fields and the order in which to display them. If this is not
>>specified, all schema fields will be displayed in the order specified in
>>the schema itself."
> 
> 
> This is the doc string for the "fields" attribute. As you can read, all fields 
> should be displayed. It might be good to also send us your IEvent interface.

I know, that's why I copied it here.

This is my complete CS.interfaces (CS\interfaces.py)

from zope.interface import Interface
from zope.app.container.interfaces import IContainer, IContained
from zope.schema import TextLine, Text, Field
from zope.app.container.constraints import ItemTypePrecondition, 
ContainerTypesConstraint

class IEvent(Interface):
     """This interface stores information about a event."""

     def __setitem__(name, object):
         """Add a IEvent object."""

     name = TextLine(
         title = u"Name",
         description = u"Short name",
         required = True)

     description = Text (
         title = u"Description",
         description = u"Longer description of the event",
         default = u"",
         required = False)

     location = Text (
         title = u"Location",
         description = u"The location where the event take place.",
         default = u"",
         required = False)

class IEventFolder(IContainer):
     def __setitem__(name, object):
         """Adds a IEventFolder object."""

     __setitem__.precondition = ItemTypePrecondition(IEvent)


class IEventContained(IContained):
     __parent__ = Field( constraint = 
ContainerTypesConstraint(IEventFolder))


And my configure.zcml (CS\configure.zcml)

<configure xmlns="http://namespaces.zope.org/zope">
   <include package=".Principal" />
   <include package=".browser" />

   <interface interface=".interfaces.IEventFolder" 
type="zope.app.content.interfaces.IContentType" />
   <content class=".event.EventFolder">
     <implements 
interface="zope.app.annotation.interfaces.IAttributeAnnotatable" />
     <implements 
interface="zope.app.container.interfaces.IContentContainer" />
     <factory id="CS.event.EventFolder" description="CS EventFolder"/>
     <require permission="zope.Public" 
interface=".interfaces.IEventFolder" />
     <require permission="zope.Public" 
set_schema=".interfaces.IEventFolder" />
	</content>
	
   <interface interface=".interfaces.IEvent" 
type="zope.app.content.interfaces.IContentType" />
     <content class=".event.Event">
     <implements 
interface="zope.app.annotation.interfaces.IAttributeAnnotatable" />
     <factory id="CS.event.Event" description="CS Event"/>
     <require permission="zope.Public" interface=".interfaces.IEvent" />
     <require permission="zope.Public" set_schema=".interfaces.IEvent" />
</content>

</configure>

Anything else you need?

TIA,

Florian



More information about the Zope3-users mailing list