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(self.request.principal))
        return interaction.checkPermission("zope.ManageContent",
self.context)

I'm trying to know if the user can add an item to a container. I don't
know how to do that with zope.security.canWrite. I tried with

zope.security.canWrite(self.context, '__data') 

since my container inherits from SampleContainer and the '__data'
attribute is a dictionariy like objet where the children are stored. I
get a ForbiddenAttribute exception with that code.


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

Reply via email to