control over deleting objects (was Re: [Zope-CMF] fine grained
permissions for adding objects)
Luca Olivetti
luca@wetron.es
Mon, 01 Jul 2002 00:58:58 +0200
Dieter Maurer wrote:
> Alternatively, you might check in
> "manage_beforeDelete" and raise an exception, when the object
> does not want to be deleted by the current user.
Not any exception though, it must be a BeforeDeleteException, like:
from OFS.ObjectManager import BeforeDeleteException
class myClass(SomeBaseClass):
....
....
def manage_beforeDelete(self,item,container):
"check if user can delete the object"
if not suitable_condition:
raise BeforeDeleteException, ('You can't delete me')
--
Luca Olivetti