Commit 4046e76b authored by Rafael Monnerat's avatar Rafael Monnerat

Treat user with Manager role as superuser.

parent 1c6b1f9b
...@@ -623,6 +623,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -623,6 +623,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
user = _getAuthenticatedUser(self) user = _getAuthenticatedUser(self)
user_str = user.getIdOrUserName() user_str = user.getIdOrUserName()
user_is_superuser = (user == system_user) or (user_str == ERP5Security.SUPER_USER) user_is_superuser = (user == system_user) or (user_str == ERP5Security.SUPER_USER)
user_is_superuser = (user == system_user) or (user_str == ERP5Security.SUPER_USER) or \
('Manager' in user.getRoles())
allowedRolesAndUsers = self._listAllowedRolesAndUsers(user) allowedRolesAndUsers = self._listAllowedRolesAndUsers(user)
role_column_dict = {} role_column_dict = {}
local_role_column_dict = {} local_role_column_dict = {}
...@@ -747,7 +749,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -747,7 +749,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
""" """
user = _getAuthenticatedUser(self) user = _getAuthenticatedUser(self)
user_str = user.getIdOrUserName() user_str = user.getIdOrUserName()
user_is_superuser = (user == system_user) or (user_str == ERP5Security.SUPER_USER) user_is_superuser = (user == system_user) or (user_str == ERP5Security.SUPER_USER) or \
('Manager' in user.getRoles())
if user_is_superuser: if user_is_superuser:
# We need no security check for super user. # We need no security check for super user.
return return
......
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