Re: [Zope3-Users] ForbiddenAttribute error

2007-07-07 Thread Hermann Himmelbauer
Am Freitag, 6. Juli 2007 16:29 schrieb Mikael Moutakis:
 Hello
 I wrote a feed aggregator using the module FeedParser. I stored the RSS
 feed url in a persistant content component and retrieved the feed data in
 the view class. But I thought that I should move the feed data into the
 content component class instead of retrieving it in the view class. I get a
 ForbiddenAttribute error when viewing the class

Please note, that ForbiddenAttribute is also raised, when an object has no 
such attribute. I'd recommend to check (e.g. via dir(object)) if the 
attribute really exists.

I'm no expert in Zope security, but I assume that ForbiddenAttribute is 
raised, as no permission is known for the attribute, simply, because it does 
not exist.

Regards,
Hermann

-- 
[EMAIL PROTECTED]
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] ForbiddenAttribute error

2007-07-06 Thread Dennis Noordsij

 require
 permission=zope.ManageContent
 set_schema=.interfaces.IFeed
   /
 /class



 Haven't I declared the getRawFeedData method by including it in the IFeed
 interface?

 Thanks!

 /Mikael M

Hi Mikael

Rest assured you have a permissions problem. (ForbiddenError)

For one thing, set_schema means that to set any attributes in that schema, you 
need this permission. But your method getRawFeedData is not a settable 
attribute, but a method. 

Notice that when you assign write permissions to a container (for example), 
you say

interface=zope.app.container.interfaces.IWriteContainer, and not 
set_schema=...

You need set_schema (or set_attributes) for the list attribute, but you need 
interface (or attributes) for your getRawFeedData method, since you just want 
to call it.

Add 
require
  permission=zope.ManageContent
  attributes=getRawFeedData
  /

and it should work. Might not be the best way though but I am sure more 
knowledgable people will step in :)

Hope it gets you closer
Dennis

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] ForbiddenAttribute error

2007-07-06 Thread Dennis Noordsij

HA! I spoke too soon.

Your permissions are OK, zope.View has the right permissions. Sorry about 
that.

Check the permissions on entries in your feed, that's where the backtrace 
points to.

D

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] ForbiddenAttribute error

2007-07-06 Thread Maciej Wisniowski
 I get a
 ForbiddenAttribute error when viewing the class
AFAIR ForbiddenAttribute means that you have no
permissions for attribute you want to access.
No permissions means that it is neither allowed
nor denied :)

You're using feed.entries:

 result+=[(e.updated_parsed, feed.channel, e) for e in
 feed.entries ]


Seems that 'entries' are the cause of error (as Dennis already said)
or something in this line.

If 'feed' above is of type Feed then your's IFeed doesn't
specify 'entries' attribute in it. This means no permissions
are set to 'entries' and this may cause ForbiddenAttribute
error.

You may use pdb to simply debug what exactly causes the error.

-- 
Maciej Wisniowski
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] ForbiddenAttribute error when adding a container

2005-09-15 Thread baiju m
On 9/14/05, Maciej Pietrzak [EMAIL PROTECTED] wrote:
 
 My guess is that you forgot to specify permissions for container interface.
 
 Add require permission=zope.View
 interface=zope.app.container.interfaces.IReadContainer/ (or
 something like that) to your ZCML file (inside condent/ element).
 

Thank you, that was the problem,
Actually I should have added (In my case):

require
permission=zope.ManageContent
interface=.interfaces.ICommentContainer/
require
permission=zope.ManageContent
interface=.interfaces.IComment/

i.e., if a container object can contain itself, I have to given permission for
both interfaces (IMyInterfce and IMyInterfceContainer)

With thanks,
Baiju M
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users