Commit ce2eac2c authored by Vincent Pelletier's avatar Vincent Pelletier

WIP: Do not disallow SUPER_USER by login.

Super-user magic must happen by id, not by name.
This may be required by other PAS plugin changes, as now SUPER_USER has
an id but no login.
Also, this requires more work on special users, to see if we can test them
by id and not by login, as well.
parent 3fcf0879
...@@ -104,7 +104,7 @@ class ERP5User(PropertiedUser): ...@@ -104,7 +104,7 @@ class ERP5User(PropertiedUser):
As for getRolesInContext, we take into account _getAcquireLocalRoles for As for getRolesInContext, we take into account _getAcquireLocalRoles for
ERP5. ERP5.
""" """
if self.getUserName() == SUPER_USER: if self.getId() == SUPER_USER:
# super user is allowed to accesss any object # super user is allowed to accesss any object
return 1 return 1
......
...@@ -110,9 +110,6 @@ class ERP5UserManager(BasePlugin): ...@@ -110,9 +110,6 @@ class ERP5UserManager(BasePlugin):
return (user_value.getReference(), login_value.getReference()) return (user_value.getReference(), login_value.getReference())
def _getLoginValueFromLogin(self, login, login_portal_type=None): def _getLoginValueFromLogin(self, login, login_portal_type=None):
# Forbidden the usage of the super user.
if login == SUPER_USER:
return
user_list = self.enumerateUsers( user_list = self.enumerateUsers(
login=login, login=login,
exact_match=True, exact_match=True,
......
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