Commit f0c8b581 authored by Fabien Morin's avatar Fabien Morin

remove useless parameter. Thanks jerome for the review


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35711 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b14770af
...@@ -56,7 +56,7 @@ class IEncryptedPassword(Interface): ...@@ -56,7 +56,7 @@ class IEncryptedPassword(Interface):
begins with _set* begins with _set*
""" """
def checkUserCanChangePassword(unauthorized_message): def checkUserCanChangePassword():
""" """
check user have permission to change his password. Raise in case he cannot. check user have permission to change his password. Raise in case he cannot.
""" """
......
...@@ -63,9 +63,9 @@ class EncryptedPasswordMixin: ...@@ -63,9 +63,9 @@ class EncryptedPasswordMixin:
return pw_validate(self.getPassword(), value) return pw_validate(self.getPassword(), value)
return False return False
def checkUserCanChangePassword(self, unauthorized_message='setPassword'): def checkUserCanChangePassword(self):
if not _checkPermission(Permissions.SetOwnPassword, self): if not _checkPermission(Permissions.SetOwnPassword, self):
raise AccessControl_Unauthorized(unauthorized_message) raise AccessControl_Unauthorized('setPassword')
def _setEncodedPassword(self, value, format='default'): def _setEncodedPassword(self, value, format='default'):
password = getattr(aq_base(self), 'password', None) password = getattr(aq_base(self), 'password', None)
...@@ -77,7 +77,7 @@ class EncryptedPasswordMixin: ...@@ -77,7 +77,7 @@ class EncryptedPasswordMixin:
def setEncodedPassword(self, value, format='default'): def setEncodedPassword(self, value, format='default'):
""" """
""" """
self.checkUserCanChangePassword('setEncodedPassword') self.checkUserCanChangePassword()
self._setEncodedPassword(value, format=format) self._setEncodedPassword(value, format=format)
self.reindexObject() self.reindexObject()
...@@ -86,7 +86,7 @@ class EncryptedPasswordMixin: ...@@ -86,7 +86,7 @@ class EncryptedPasswordMixin:
self._setEncodedPassword(pw_encrypt(value)) self._setEncodedPassword(pw_encrypt(value))
def _setPassword(self, value): def _setPassword(self, value):
self.checkUserCanChangePassword('setPassword') self.checkUserCanChangePassword()
self._forceSetPassword(value) self._forceSetPassword(value)
security.declarePublic('setPassword') security.declarePublic('setPassword')
......
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