[gen] Minor updates.
This commit is contained in:
parent
31a0268641
commit
61b0ed2fce
|
@ -1 +1 @@
|
|||
0.8.0
|
||||
0.8.1
|
||||
|
|
|
@ -1823,7 +1823,8 @@ class Ref(Type):
|
|||
if not res: return res
|
||||
# We add here specific Ref rules for preventing to show the field under
|
||||
# some inappropriate circumstances.
|
||||
if (layoutType == 'edit') and (self.add or not self.link): return False
|
||||
if (layoutType == 'edit') and \
|
||||
(self.mayAdd(obj) or not self.link): return False
|
||||
if self.isBack:
|
||||
if layoutType == 'edit': return False
|
||||
else: return getattr(obj.aq_base, self.name, None)
|
||||
|
|
|
@ -169,6 +169,9 @@ class UserWrapper(AbstractWrapper):
|
|||
del self.o.__ac_local_roles__[None]
|
||||
return self._callCustom('onEdit', created)
|
||||
|
||||
def mayEdit(self): return self._callCustom('mayEdit')
|
||||
def mayDelete(self): return self._callCustom('mayDelete')
|
||||
|
||||
def getZopeUser(self):
|
||||
'''Gets the Zope user corresponding to this user.'''
|
||||
return self.o.acl_users.getUser(self.login)
|
||||
|
@ -180,6 +183,12 @@ class UserWrapper(AbstractWrapper):
|
|||
# Call a custom "onDelete" if any.
|
||||
return self._callCustom('onDelete')
|
||||
|
||||
# Methods that are defined on the Zope user class, wrapped on this class.
|
||||
def has_role(self, role, obj=None):
|
||||
user = self.user
|
||||
if obj: return user.has_role(role, obj)
|
||||
return user.has_role(role)
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
try:
|
||||
from AccessControl.PermissionRole import _what_not_even_god_should_do, \
|
||||
|
|
Loading…
Reference in a new issue