-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Does not allow a Site Administrator to change a Manager's email and
password
- Loading branch information
Showing
7 changed files
with
100 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"POT-Creation-Date: 2023-09-21 15:17+0000\n" | ||
"POT-Creation-Date: 2023-09-25 20:32+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" | ||
"Last-Translator: Timo Stollenwerk <[email protected]>\n" | ||
"Language-Team: German <[email protected]>\n" | ||
|
@@ -147,7 +147,7 @@ msgstr "" | |
msgid "Volto Blocks" | ||
msgstr "" | ||
|
||
#: plone/restapi/services/users/update.py:139 | ||
#: plone/restapi/services/users/update.py:151 | ||
msgid "You are not authorized to perform this action" | ||
msgstr "" | ||
|
||
|
@@ -163,14 +163,18 @@ msgstr "" | |
msgid "You can't set a password without a password reset token." | ||
msgstr "" | ||
|
||
#: plone/restapi/services/users/update.py:108 | ||
#: plone/restapi/services/users/update.py:120 | ||
msgid "You can't update roles of this user" | ||
msgstr "" | ||
|
||
#: plone/restapi/services/users/update.py:145 | ||
#: plone/restapi/services/users/update.py:157 | ||
msgid "You can't update the properties of this user" | ||
msgstr "" | ||
|
||
#: plone/restapi/services/users/update.py:94 | ||
msgid "You can't update this user" | ||
msgstr "" | ||
|
||
#: plone/restapi/services/users/add.py:284 | ||
msgid "You can't use 'reset_token' and 'old_password' together." | ||
msgstr "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Plone\n" | ||
"POT-Creation-Date: 2023-09-21 15:17+0000\n" | ||
"POT-Creation-Date: 2023-09-25 20:32+0000\n" | ||
"PO-Revision-Date: 2023-08-23 21:19-0400\n" | ||
"Last-Translator: Leonardo J. Caballero G. <[email protected]>\n" | ||
"Language-Team: ES <[email protected]>\n" | ||
|
@@ -153,7 +153,7 @@ msgstr "El reset_token es desconocido/no válido." | |
msgid "Volto Blocks" | ||
msgstr "Bloques Volto" | ||
|
||
#: plone/restapi/services/users/update.py:139 | ||
#: plone/restapi/services/users/update.py:151 | ||
msgid "You are not authorized to perform this action" | ||
msgstr "No está autorizado a realizar esta acción." | ||
|
||
|
@@ -169,14 +169,18 @@ msgstr "No puede enviar la contraseña y 'Enviar un correo electrónico de confi | |
msgid "You can't set a password without a password reset token." | ||
msgstr "No puede establecer una contraseña sin un token de restablecimiento de contraseña." | ||
|
||
#: plone/restapi/services/users/update.py:108 | ||
#: plone/restapi/services/users/update.py:120 | ||
msgid "You can't update roles of this user" | ||
msgstr "" | ||
|
||
#: plone/restapi/services/users/update.py:145 | ||
#: plone/restapi/services/users/update.py:157 | ||
msgid "You can't update the properties of this user" | ||
msgstr "No puede actualizar las propiedades de este usuario." | ||
|
||
#: plone/restapi/services/users/update.py:94 | ||
msgid "You can't update this user" | ||
msgstr "" | ||
|
||
#: plone/restapi/services/users/add.py:284 | ||
msgid "You can't use 'reset_token' and 'old_password' together." | ||
msgstr "No puede utilizar 'Restablecer token' y 'Contraseña anterior' juntas." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"POT-Creation-Date: 2023-09-21 15:17+0000\n" | ||
"POT-Creation-Date: 2023-09-25 20:32+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" | ||
"Last-Translator: Julien Chandelle <[email protected]>\n" | ||
"Language-Team: French <[email protected]>\n" | ||
|
@@ -147,7 +147,7 @@ msgstr "Le reset_token est inconnu/non valide." | |
msgid "Volto Blocks" | ||
msgstr "Blocs Volto" | ||
|
||
#: plone/restapi/services/users/update.py:139 | ||
#: plone/restapi/services/users/update.py:151 | ||
msgid "You are not authorized to perform this action" | ||
msgstr "Vous n'êtes pas autorisé à effectuer cette action" | ||
|
||
|
@@ -163,14 +163,18 @@ msgstr "Vous ne pouvez pas envoyer à la fois le password et sendPasswordReset" | |
msgid "You can't set a password without a password reset token." | ||
msgstr "Vous ne pouvez pas définir de mot de passe sans un jeton de réinitialisation de mot de passe." | ||
|
||
#: plone/restapi/services/users/update.py:108 | ||
#: plone/restapi/services/users/update.py:120 | ||
msgid "You can't update roles of this user" | ||
msgstr "" | ||
|
||
#: plone/restapi/services/users/update.py:145 | ||
#: plone/restapi/services/users/update.py:157 | ||
msgid "You can't update the properties of this user" | ||
msgstr "Vous ne pouvez pas mettre à jour les propriétés de cet utilisateur" | ||
|
||
#: plone/restapi/services/users/update.py:94 | ||
msgid "You can't update this user" | ||
msgstr "" | ||
|
||
#: plone/restapi/services/users/add.py:284 | ||
msgid "You can't use 'reset_token' and 'old_password' together." | ||
msgstr "Vous ne pouvez pas utiliser 'reset_token' et 'old_password' ensemble." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"POT-Creation-Date: 2023-09-21 15:17+0000\n" | ||
"POT-Creation-Date: 2023-09-25 20:32+0000\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -150,7 +150,7 @@ msgstr "" | |
msgid "Volto Blocks" | ||
msgstr "" | ||
|
||
#: plone/restapi/services/users/update.py:139 | ||
#: plone/restapi/services/users/update.py:151 | ||
msgid "You are not authorized to perform this action" | ||
msgstr "" | ||
|
||
|
@@ -166,14 +166,18 @@ msgstr "" | |
msgid "You can't set a password without a password reset token." | ||
msgstr "" | ||
|
||
#: plone/restapi/services/users/update.py:108 | ||
#: plone/restapi/services/users/update.py:120 | ||
msgid "You can't update roles of this user" | ||
msgstr "" | ||
|
||
#: plone/restapi/services/users/update.py:145 | ||
#: plone/restapi/services/users/update.py:157 | ||
msgid "You can't update the properties of this user" | ||
msgstr "" | ||
|
||
#: plone/restapi/services/users/update.py:94 | ||
msgid "You can't update this user" | ||
msgstr "" | ||
|
||
#: plone/restapi/services/users/add.py:284 | ||
msgid "You can't use 'reset_token' and 'old_password' together." | ||
msgstr "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,6 +105,15 @@ def set_siteadm(self): | |
self.api_session.auth = (siteadm_username, siteadm_password) | ||
transaction.commit() | ||
|
||
def create_manager(self): | ||
api.user.create( | ||
email="[email protected]", | ||
roles=["Manager"], | ||
username="manager", | ||
password="managerpassword", | ||
) | ||
transaction.commit() | ||
|
||
def test_list_users(self): | ||
response = self.api_session.get("/@users") | ||
|
||
|
@@ -1394,3 +1403,41 @@ def test_siteadm_not_add_manager(self): | |
transaction.commit() | ||
|
||
self.assertIsNone(api.user.get(userid="howard")) | ||
|
||
def test_siteadm_not_change_manager_password(self): | ||
self.set_siteadm() | ||
self.create_manager() | ||
self.api_session.patch( | ||
"/@users/manager", | ||
json={ | ||
"password": "newmanagerpassword", | ||
}, | ||
) | ||
transaction.commit() | ||
|
||
response = self.api_session.post( | ||
"/@login", | ||
json={ | ||
"login": "manager", | ||
"password": "newmanagerpassword", | ||
}, | ||
) | ||
|
||
self.assertEqual( | ||
"Wrong login and/or password.", response.json()["error"]["message"] | ||
) | ||
|
||
def test_siteadm_not_change_manager_email(self): | ||
self.set_siteadm() | ||
self.create_manager() | ||
self.api_session.patch( | ||
"/@users/manager", | ||
json={ | ||
"email": "[email protected]", | ||
}, | ||
) | ||
transaction.commit() | ||
|
||
self.assertEqual( | ||
"[email protected]", api.user.get(userid="manager").getProperty("email") | ||
) |