Commit 38793ce8 authored by Ivan Tyagov's avatar Ivan Tyagov

Split isWebMode and isEditableMode API and make sure that they do what exactly their names states.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39675 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e04ae650
...@@ -3381,28 +3381,23 @@ class Base( CopyContainer, ...@@ -3381,28 +3381,23 @@ class Base( CopyContainer,
security.declarePublic('isWebMode') security.declarePublic('isWebMode')
def isWebMode(self): def isWebMode(self):
""" """
return True if we are in web_mode and if editable_mode is NOT set return True if we are in web mode
""" """
if self.getApplicableLayout() is None: if self.getApplicableLayout() is None:
return False return False
if getattr(self.REQUEST, 'ignore_layout', 0): if getattr(self.REQUEST, 'ignore_layout', 0):
return False return False
if getattr(self.REQUEST, 'editable_mode', 0):
return False
return True return True
security.declarePublic('isEditableWebMode') security.declarePublic('isEditableWebMode')
def isEditableWebMode(self): def isEditableWebMode(self):
""" """
return True if we are in web_mode and if editable_mode is set return True if we are in editable mode
""" """
if self.getApplicableLayout() is None: return getattr(self.REQUEST, 'editable_mode', 0)
return False
if getattr(self.REQUEST, 'ignore_layout', 0): isEditableMode = isEditableWebMode # for backwards compatability
return False
if not getattr(self.REQUEST, 'editable_mode', 1):
return False
return True
security.declareProtected(Permissions.ChangeLocalRoles, security.declareProtected(Permissions.ChangeLocalRoles,
'updateLocalRolesOnSecurityGroups') 'updateLocalRolesOnSecurityGroups')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment