Re: [Zope3-Users] Re: how to know if a principal has the right permissions

2006-08-28 Thread Philipp von Weitershausen
Lorenzo Gil Sanchez wrote: > El lun, 28-08-2006 a las 20:49 +0200, Philipp von Weitershausen > escribió: >> Lorenzo Gil Sanchez wrote: Right. Because you're not supposed to poke at __data. The two underscores should scare you off! By the way, this is a rule of thumb: W

Re: [Zope3-Users] Re: how to know if a principal has the right permissions

2006-08-28 Thread Lorenzo Gil Sanchez
El lun, 28-08-2006 a las 20:49 +0200, Philipp von Weitershausen escribió: > Lorenzo Gil Sanchez wrote: > >> Right. Because you're not supposed to poke at __data. The two > >> underscores should scare you off! > >> > >> By the way, this is a rule of thumb: > >> > >> Whenever you get ForbiddenAttribu

Re: [Zope3-Users] Re: how to know if a principal has the right permissions

2006-08-28 Thread Philipp von Weitershausen
Lorenzo Gil Sanchez wrote: >> Right. Because you're not supposed to poke at __data. The two >> underscores should scare you off! >> >> By the way, this is a rule of thumb: >> >> Whenever you get ForbiddenAttribute errors, you're doing something >> wrong. Either: >> >> 1. you're missing security d

Re: [Zope3-Users] Re: how to know if a principal has the right permissions

2006-08-28 Thread Lorenzo Gil Sanchez
El lun, 28-08-2006 a las 20:35 +0200, Philipp von Weitershausen escribió: > Ack. Just get the current interaction with > zope.security.management.getInteraction(). With this code you're > hard-wiring yourself to the security policy in zope.app.securitypolicy. > Thanks, that's good to know. > Ri

Re: [Zope3-Users] Re: how to know if a principal has the right permissions

2006-08-28 Thread Philipp von Weitershausen
Lorenzo Gil Sanchez wrote: > El dom, 27-08-2006 a las 23:53 +0200, Philipp von Weitershausen > escribió: > >> zope.security.canAccess >> zope.security.canWrite > > Nice, I didn't know about those and I ended writing my own solution: > > def canAdd(self): > interaction = ZopeSecurityP

Re: [Zope3-Users] Re: how to know if a principal has the right permissions

2006-08-28 Thread Lorenzo Gil Sanchez
El dom, 27-08-2006 a las 23:53 +0200, Philipp von Weitershausen escribió: > zope.security.canAccess > zope.security.canWrite Nice, I didn't know about those and I ended writing my own solution: def canAdd(self): interaction = ZopeSecurityPolicy() interaction.add(Participation

[Zope3-Users] Re: how to know if a principal has the right permissions

2006-08-27 Thread Philipp von Weitershausen
Lorenzo Gil Sanchez wrote: > Hello, > > I have a INewsItem content type that anonynmous users can see but only > editors can create/edit/remove. I have a view which list all my news > items. I want to show links from this view to the add, edit and remove > views for every news item but only if the