[Zope3-Users] ForbiddenAttribute or unknown attribute?

Marius Gedminas mgedmin at b4net.lt
Sun Oct 15 13:28:30 EDT 2006


On Sun, Oct 15, 2006 at 03:20:17PM +0200, Christophe Combelles wrote:
> In the link below, it is said that the ForbiddenAttribute exception is 
> ALWAYS a problem of permission.
> http://kpug.zwiki.org/Zope3Faq#what-is-forbiddenattribute-exception-error
> 
> But if you try to access an attribute that simply does not exist, you also 
> get this error. In this case, it is has nothing to do with permission.

Yes, that's often confusing.  But consider: ForbiddenAttribute means
that there is no security declaration for that particular attribute.
You usually don't write security declarations for attributes that do not
exist.  Zope checks security declarations before it checks for the
existence of an attribute.

> Is there no UnknowAttribute error?

It's called AttributeError.  You will get it if you try to access a
missing attribute on an object that is not security proxied, or in case
you do have a security declaration allowing accesss to this attribute,
but your object doesn't actually have the attribute.

Marius Gedminas
-- 
"...the only place for 63,000 bugs is a rain forest"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20061015/dafdaba2/attachment.bin


More information about the Zope3-users mailing list