[gen] Added some utility methods.

This commit is contained in:
Gaetan Delannay 2014-06-01 11:44:07 +02:00
parent 2eee217b05
commit 6494bf22c7
3 changed files with 35 additions and 1 deletions

View file

@ -1095,4 +1095,12 @@ class AbstractWrapper(object):
def allows(self, permission, raiseError=False):
'''Check doc @Mixin.allows.'''
return self.o.allows(permission, raiseError=raiseError)
def resetLocalRoles(self):
'''Removes all local roles defined on this object, excepted local role
Owner, granted to the item creator.'''
from persistent.mapping import PersistentMapping
localRoles = PersistentMapping({ self.o.creator: ['Owner'] })
self.o.__ac_local_roles__ = localRoles
return localRoles
# ------------------------------------------------------------------------------