From 1fc4a92c1166f1858a25a8471fd164badd91c71b Mon Sep 17 00:00:00 2001 From: wesleybl Date: Thu, 21 Sep 2023 15:04:42 -0300 Subject: [PATCH] Does not allow a Site Administrator to set a Manager role --- .../locales/de/LC_MESSAGES/plone.restapi.po | 78 +++++++++--------- .../locales/es/LC_MESSAGES/plone.restapi.po | 80 ++++++++++--------- .../locales/fr/LC_MESSAGES/plone.restapi.po | 78 +++++++++--------- src/plone/restapi/locales/plone.restapi.pot | 78 +++++++++--------- .../pt_BR/LC_MESSAGES/plone.restapi.po | 78 +++++++++--------- src/plone/restapi/services/users/update.py | 20 ++++- .../restapi/tests/test_services_users.py | 53 ++++++++++++ 7 files changed, 278 insertions(+), 187 deletions(-) diff --git a/src/plone/restapi/locales/de/LC_MESSAGES/plone.restapi.po b/src/plone/restapi/locales/de/LC_MESSAGES/plone.restapi.po index 4a2b3ccf9a..4c6904f6db 100644 --- a/src/plone/restapi/locales/de/LC_MESSAGES/plone.restapi.po +++ b/src/plone/restapi/locales/de/LC_MESSAGES/plone.restapi.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2022-12-29 15:58+0000\n" +"POT-Creation-Date: 2023-09-21 15:17+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: Timo Stollenwerk \n" "Language-Team: German \n" @@ -14,11 +14,11 @@ msgstr "" "Preferred-Encodings: utf-8 latin1\n" "Domain: plone.restapi\n" -#: plone/restapi/services/email_send/post.py:81 +#: plone/restapi/services/email_send/post.py:88 msgid "${sender_fullname} via ${portal_title}" msgstr "${sender_fullname} via ${portal_title}" -#: plone/restapi/services/email_send/post.py:74 +#: plone/restapi/services/email_send/post.py:81 msgid "A portal user via ${portal_title}" msgstr "Ein Portal Nutzer via ${portal_title}" @@ -34,23 +34,23 @@ msgstr "" msgid "Adds sample workflows for testing" msgstr "" -#: plone/restapi/services/aliases/add.py:106 +#: plone/restapi/services/aliases/add.py:107 msgid "Alternative urls that point to themselves will cause an endless cycle of redirects." msgstr "" -#: plone/restapi/configure.zcml:115 +#: plone/restapi/configure.zcml:116 msgid "Blocks" msgstr "" -#: plone/restapi/configure.zcml:122 +#: plone/restapi/configure.zcml:123 msgid "Blocks (Editable Layout)" msgstr "" -#: plone/restapi/configure.zcml:122 +#: plone/restapi/configure.zcml:123 msgid "Enables Volto Blocks (editable layout) support" msgstr "" -#: plone/restapi/configure.zcml:115 +#: plone/restapi/configure.zcml:116 msgid "Enables Volto Blocks support" msgstr "" @@ -58,7 +58,7 @@ msgstr "" msgid "Enables blocks on the Document content type" msgstr "" -#: plone/restapi/services/contextnavigation/get.py:133 +#: plone/restapi/services/contextnavigation/get.py:136 msgid "Enter a valid scale name (see 'Image Handling' control panel) to override (e.g. icon, tile, thumb, mini, preview, ... ). Leave empty to use default (see 'Site' control panel)." msgstr "" @@ -67,15 +67,15 @@ msgid "Error in fields. ${errors_to_string}" msgstr "" #. Default: "The reset_token is expired." -#: plone/restapi/services/users/add.py:312 +#: plone/restapi/services/users/add.py:319 msgid "Expired Token" msgstr "" -#: plone/restapi/services/contextnavigation/get.py:126 +#: plone/restapi/services/contextnavigation/get.py:129 msgid "If enabled, the portlet will not show document type icons." msgstr "" -#: plone/restapi/services/contextnavigation/get.py:145 +#: plone/restapi/services/contextnavigation/get.py:148 msgid "If enabled, the portlet will not show thumbs." msgstr "" @@ -91,11 +91,11 @@ msgstr "" msgid "Layout" msgstr "" -#: plone/restapi/services/contextnavigation/get.py:195 +#: plone/restapi/services/contextnavigation/get.py:197 msgid "Navigation" msgstr "" -#: plone/restapi/services/contextnavigation/get.py:132 +#: plone/restapi/services/contextnavigation/get.py:135 msgid "Override thumb scale" msgstr "" @@ -123,23 +123,23 @@ msgstr "" msgid "Roles" msgstr "" -#: plone/restapi/services/users/add.py:350 +#: plone/restapi/services/users/add.py:357 msgid "See the user endpoint documentation for the valid parameters." msgstr "" -#: plone/restapi/services/contextnavigation/get.py:125 +#: plone/restapi/services/contextnavigation/get.py:128 msgid "Suppress Icons" msgstr "" -#: plone/restapi/services/contextnavigation/get.py:144 +#: plone/restapi/services/contextnavigation/get.py:147 msgid "Suppress thumbs" msgstr "" -#: plone/restapi/services/users/add.py:342 +#: plone/restapi/services/users/add.py:349 msgid "The password passed as 'old_password' is wrong." msgstr "" -#: plone/restapi/services/users/add.py:307 +#: plone/restapi/services/users/add.py:314 msgid "The reset_token is unknown/not valid." msgstr "" @@ -147,11 +147,11 @@ msgstr "" msgid "Volto Blocks" msgstr "" -#: plone/restapi/services/users/update.py:119 +#: plone/restapi/services/users/update.py:139 msgid "You are not authorized to perform this action" msgstr "" -#: plone/restapi/services/email_send/post.py:91 +#: plone/restapi/services/email_send/post.py:98 msgid "You are receiving this mail because ${sender_fullname} sent this message via the site ${portal_title}:" msgstr "Sie erhalten diese E-Mail, weil Ihnen ${sender_fullname} diese Nachricht über die Webseite ${portal_title} geschickt hat:" @@ -159,11 +159,15 @@ msgstr "Sie erhalten diese E-Mail, weil Ihnen ${sender_fullname} diese Nachricht msgid "You can't send both password and sendPasswordReset." msgstr "" -#: plone/restapi/services/users/add.py:322 +#: plone/restapi/services/users/add.py:329 msgid "You can't set a password without a password reset token." msgstr "" -#: plone/restapi/services/users/update.py:125 +#: plone/restapi/services/users/update.py:108 +msgid "You can't update roles of this user" +msgstr "" + +#: plone/restapi/services/users/update.py:145 msgid "You can't update the properties of this user" msgstr "" @@ -179,72 +183,72 @@ msgstr "" msgid "You need AddPortalMember permission." msgstr "" -#: plone/restapi/services/users/add.py:329 +#: plone/restapi/services/users/add.py:336 msgid "You need to be logged in as the user '${username}' to set the password." msgstr "" #. Default: "Missing dependency" -#: plone/restapi/services/addons/addons.py:207 +#: plone/restapi/services/addons/addons.py:212 msgid "dependency_missing" msgstr "" #. Default: "If selected, the navigation tree will only show the current folder and its children at all times." -#: plone/restapi/services/contextnavigation/get.py:84 +#: plone/restapi/services/contextnavigation/get.py:87 msgid "help_current_folder_only" msgstr "" #. Default: "Whether or not to show the top, or 'root', node in the navigation tree. This is affected by the 'Start level' setting." -#: plone/restapi/services/contextnavigation/get.py:69 +#: plone/restapi/services/contextnavigation/get.py:72 msgid "help_include_top_node" msgstr "" #. Default: "You may search for and choose a folder to act as the root of the navigation tree. Leave blank to use the Plone site root." -#: plone/restapi/services/contextnavigation/get.py:58 +#: plone/restapi/services/contextnavigation/get.py:61 msgid "help_navigation_root" msgstr "" #. Default: "An integer value that specifies the number of folder levels below the site root that must be exceeded before the navigation tree will display. 0 means that the navigation tree should be displayed everywhere including pages in the root of the site. 1 means the tree only shows up inside folders located in the root and downwards, never showing at the top level." -#: plone/restapi/services/contextnavigation/get.py:96 +#: plone/restapi/services/contextnavigation/get.py:99 msgid "help_navigation_start_level" msgstr "" #. Default: "The title of the navigation tree." -#: plone/restapi/services/contextnavigation/get.py:49 +#: plone/restapi/services/contextnavigation/get.py:52 msgid "help_navigation_title" msgstr "" #. Default: "How many folders should be included before the navigation tree stops. 0 means no limit. 1 only includes the root folder." -#: plone/restapi/services/contextnavigation/get.py:113 +#: plone/restapi/services/contextnavigation/get.py:116 msgid "help_navigation_tree_depth" msgstr "" #. Default: "Only show the contents of the current folder." -#: plone/restapi/services/contextnavigation/get.py:80 +#: plone/restapi/services/contextnavigation/get.py:83 msgid "label_current_folder_only" msgstr "" #. Default: "Include top node" -#: plone/restapi/services/contextnavigation/get.py:68 +#: plone/restapi/services/contextnavigation/get.py:71 msgid "label_include_top_node" msgstr "" #. Default: "Root node" -#: plone/restapi/services/contextnavigation/get.py:57 +#: plone/restapi/services/contextnavigation/get.py:60 msgid "label_navigation_root_path" msgstr "" #. Default: "Start level" -#: plone/restapi/services/contextnavigation/get.py:95 +#: plone/restapi/services/contextnavigation/get.py:98 msgid "label_navigation_startlevel" msgstr "" #. Default: "Title" -#: plone/restapi/services/contextnavigation/get.py:48 +#: plone/restapi/services/contextnavigation/get.py:51 msgid "label_navigation_title" msgstr "" #. Default: "Navigation tree depth" -#: plone/restapi/services/contextnavigation/get.py:112 +#: plone/restapi/services/contextnavigation/get.py:115 msgid "label_navigation_tree_depth" msgstr "" diff --git a/src/plone/restapi/locales/es/LC_MESSAGES/plone.restapi.po b/src/plone/restapi/locales/es/LC_MESSAGES/plone.restapi.po index b957833eec..23e64c683c 100644 --- a/src/plone/restapi/locales/es/LC_MESSAGES/plone.restapi.po +++ b/src/plone/restapi/locales/es/LC_MESSAGES/plone.restapi.po @@ -4,11 +4,10 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2019-12-09 10:14+0000\n" +"POT-Creation-Date: 2023-09-21 15:17+0000\n" "PO-Revision-Date: 2023-08-23 21:19-0400\n" "Last-Translator: Leonardo J. Caballero G. \n" "Language-Team: ES \n" -"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -17,14 +16,15 @@ msgstr "" "Language-Name: Español\n" "Preferred-Encodings: utf-8 latin1\n" "Domain: plone.restapi\n" +"Language: es\n" "X-Generator: Poedit 3.3.2\n" "X-Is-Fallback-For: es-ar es-bo es-cl es-co es-cr es-do es-ec es-es es-sv es-gt es-hn es-mx es-ni es-pa es-py es-pe es-pr es-us es-uy es-ve\n" -#: plone/restapi/services/email_send/post.py:81 +#: plone/restapi/services/email_send/post.py:88 msgid "${sender_fullname} via ${portal_title}" msgstr "${sender_fullname} vía ${portal_title}" -#: plone/restapi/services/email_send/post.py:74 +#: plone/restapi/services/email_send/post.py:81 msgid "A portal user via ${portal_title}" msgstr "Un usuario de portal user vía ${portal_title}" @@ -40,23 +40,23 @@ msgstr "Añadir tipos de contenido de ejemplo para pruebas" msgid "Adds sample workflows for testing" msgstr "Añadir flujos de trabajo de muestra para realizar pruebas" -#: plone/restapi/services/aliases/add.py:106 +#: plone/restapi/services/aliases/add.py:107 msgid "Alternative urls that point to themselves will cause an endless cycle of redirects." msgstr "Las URL alternativas que apuntan a sí mismas provocarán un bucle interminable de redireccionamientos." -#: plone/restapi/configure.zcml:115 +#: plone/restapi/configure.zcml:116 msgid "Blocks" msgstr "Bloques" -#: plone/restapi/configure.zcml:122 +#: plone/restapi/configure.zcml:123 msgid "Blocks (Editable Layout)" msgstr "Bloques (Diseño editable)" -#: plone/restapi/configure.zcml:122 +#: plone/restapi/configure.zcml:123 msgid "Enables Volto Blocks (editable layout) support" msgstr "Habilita el soporte para bloques Volto (diseño editable)" -#: plone/restapi/configure.zcml:115 +#: plone/restapi/configure.zcml:116 msgid "Enables Volto Blocks support" msgstr "Habilitar soporte a Bloques Volto" @@ -64,7 +64,7 @@ msgstr "Habilitar soporte a Bloques Volto" msgid "Enables blocks on the Document content type" msgstr "Habilitar bloques en el tipo de contenido Documento" -#: plone/restapi/services/contextnavigation/get.py:133 +#: plone/restapi/services/contextnavigation/get.py:136 msgid "Enter a valid scale name (see 'Image Handling' control panel) to override (e.g. icon, tile, thumb, mini, preview, ... ). Leave empty to use default (see 'Site' control panel)." msgstr "Introducir un nombre de escala válido (consulte 'Manipulación de imágenes' en el panel de control) para anular (por ejemplo, icon, tile, thumb, mini, preview...). Déjelo en blanco para usar el valor predeterminado (consulte 'Sitio' en el panel de control)." @@ -73,15 +73,15 @@ msgid "Error in fields. ${errors_to_string}" msgstr "Errores en los campos. ${errors_to_string}" #. Default: "The reset_token is expired." -#: plone/restapi/services/users/add.py:312 +#: plone/restapi/services/users/add.py:319 msgid "Expired Token" msgstr "Token caducado" -#: plone/restapi/services/contextnavigation/get.py:126 +#: plone/restapi/services/contextnavigation/get.py:129 msgid "If enabled, the portlet will not show document type icons." msgstr "Si está habilitado, el portlet no mostrará los iconos de tipo de contenido." -#: plone/restapi/services/contextnavigation/get.py:145 +#: plone/restapi/services/contextnavigation/get.py:148 msgid "If enabled, the portlet will not show thumbs." msgstr "Si está habilitado, el portlet no mostrará miniaturas." @@ -97,11 +97,11 @@ msgstr "Si introduce 'Restablecer token' debe ingresar 'Nueva contraseña'" msgid "Layout" msgstr "Diseño" -#: plone/restapi/services/contextnavigation/get.py:195 +#: plone/restapi/services/contextnavigation/get.py:197 msgid "Navigation" msgstr "Navegación" -#: plone/restapi/services/contextnavigation/get.py:132 +#: plone/restapi/services/contextnavigation/get.py:135 msgid "Override thumb scale" msgstr "Anular escala de miniaturas" @@ -129,23 +129,23 @@ msgstr "Revertido para revisión ${version}" msgid "Roles" msgstr "Roles" -#: plone/restapi/services/users/add.py:350 +#: plone/restapi/services/users/add.py:357 msgid "See the user endpoint documentation for the valid parameters." msgstr "Consulte la documentación del usuario del terminal para conocer los parámetros válidos." -#: plone/restapi/services/contextnavigation/get.py:125 +#: plone/restapi/services/contextnavigation/get.py:128 msgid "Suppress Icons" msgstr "Suprimir iconos" -#: plone/restapi/services/contextnavigation/get.py:144 +#: plone/restapi/services/contextnavigation/get.py:147 msgid "Suppress thumbs" msgstr "Suprimir miniaturas" -#: plone/restapi/services/users/add.py:342 +#: plone/restapi/services/users/add.py:349 msgid "The password passed as 'old_password' is wrong." msgstr "La contraseña pasada como \"Contraseña anterior\" no es válida." -#: plone/restapi/services/users/add.py:307 +#: plone/restapi/services/users/add.py:314 msgid "The reset_token is unknown/not valid." msgstr "El reset_token es desconocido/no válido." @@ -153,11 +153,11 @@ msgstr "El reset_token es desconocido/no válido." msgid "Volto Blocks" msgstr "Bloques Volto" -#: plone/restapi/services/users/update.py:119 +#: plone/restapi/services/users/update.py:139 msgid "You are not authorized to perform this action" msgstr "No está autorizado a realizar esta acción." -#: plone/restapi/services/email_send/post.py:91 +#: plone/restapi/services/email_send/post.py:98 msgid "You are receiving this mail because ${sender_fullname} sent this message via the site ${portal_title}:" msgstr "Está recibiendo este correo porque ${sender_fullname} envió este mensaje a través del sitio ${portal_title}:" @@ -165,11 +165,15 @@ msgstr "Está recibiendo este correo porque ${sender_fullname} envió este mensa msgid "You can't send both password and sendPasswordReset." msgstr "No puede enviar la contraseña y 'Enviar un correo electrónico de confirmación con un enlace para establecer la contraseña'." -#: plone/restapi/services/users/add.py:322 +#: plone/restapi/services/users/add.py:329 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:125 +#: plone/restapi/services/users/update.py:108 +msgid "You can't update roles of this user" +msgstr "" + +#: plone/restapi/services/users/update.py:145 msgid "You can't update the properties of this user" msgstr "No puede actualizar las propiedades de este usuario." @@ -185,72 +189,72 @@ msgstr "Debe enviar una contraseña o 'Enviar un correo electrónico de confirma msgid "You need AddPortalMember permission." msgstr "Necesita el permiso AddPortalMember." -#: plone/restapi/services/users/add.py:329 +#: plone/restapi/services/users/add.py:336 msgid "You need to be logged in as the user '${username}' to set the password." msgstr "Debe iniciar sesión como usuario '${username}' para poder establecer la contraseña." #. Default: "Missing dependency" -#: plone/restapi/services/addons/addons.py:207 +#: plone/restapi/services/addons/addons.py:212 msgid "dependency_missing" msgstr "Dependencia faltante" #. Default: "If selected, the navigation tree will only show the current folder and its children at all times." -#: plone/restapi/services/contextnavigation/get.py:84 +#: plone/restapi/services/contextnavigation/get.py:87 msgid "help_current_folder_only" msgstr "Si se selecciona, el árbol de navegación siempre mostrará solo la carpeta actual y sus hijos." #. Default: "Whether or not to show the top, or 'root', node in the navigation tree. This is affected by the 'Start level' setting." -#: plone/restapi/services/contextnavigation/get.py:69 +#: plone/restapi/services/contextnavigation/get.py:72 msgid "help_include_top_node" msgstr "Si el nodo superior, o 'raíz', debe mostrarse o no en el árbol de navegación. Esto se ve afectado por la configuración del 'Nivel inicial'." #. Default: "You may search for and choose a folder to act as the root of the navigation tree. Leave blank to use the Plone site root." -#: plone/restapi/services/contextnavigation/get.py:58 +#: plone/restapi/services/contextnavigation/get.py:61 msgid "help_navigation_root" msgstr "Puede buscar y seleccionar una carpeta para que actúe como raíz del árbol de navegación. Déjelo en blanco para usar la raíz del sitio Plone." #. Default: "An integer value that specifies the number of folder levels below the site root that must be exceeded before the navigation tree will display. 0 means that the navigation tree should be displayed everywhere including pages in the root of the site. 1 means the tree only shows up inside folders located in the root and downwards, never showing at the top level." -#: plone/restapi/services/contextnavigation/get.py:96 +#: plone/restapi/services/contextnavigation/get.py:99 msgid "help_navigation_start_level" msgstr "Un valor entero que especifica el número de niveles de carpeta debajo de la raíz del sitio que se deben exceder antes de que se muestre el árbol de navegación. 0 significa que el árbol de navegación debe mostrarse en cualquier lugar, incluidas las páginas en la raíz del sitio. 1 significa que el árbol solo aparecerá dentro de las carpetas ubicadas en la raíz y debajo de ella, y nunca aparecerá en el nivel raíz." #. Default: "The title of the navigation tree." -#: plone/restapi/services/contextnavigation/get.py:49 +#: plone/restapi/services/contextnavigation/get.py:52 msgid "help_navigation_title" msgstr "El título del árbol de navegación." #. Default: "How many folders should be included before the navigation tree stops. 0 means no limit. 1 only includes the root folder." -#: plone/restapi/services/contextnavigation/get.py:113 +#: plone/restapi/services/contextnavigation/get.py:116 msgid "help_navigation_tree_depth" msgstr "Cuántas carpetas se deben incluir antes de que se detenga el árbol de navegación. 0 significa sin límite. 1 significa incluir solo la carpeta raíz." #. Default: "Only show the contents of the current folder." -#: plone/restapi/services/contextnavigation/get.py:80 +#: plone/restapi/services/contextnavigation/get.py:83 msgid "label_current_folder_only" msgstr "Muestra solo el contenido de la carpeta actual." #. Default: "Include top node" -#: plone/restapi/services/contextnavigation/get.py:68 +#: plone/restapi/services/contextnavigation/get.py:71 msgid "label_include_top_node" msgstr "Incluir nodo superior" #. Default: "Root node" -#: plone/restapi/services/contextnavigation/get.py:57 +#: plone/restapi/services/contextnavigation/get.py:60 msgid "label_navigation_root_path" msgstr "Nodo raíz" #. Default: "Start level" -#: plone/restapi/services/contextnavigation/get.py:95 +#: plone/restapi/services/contextnavigation/get.py:98 msgid "label_navigation_startlevel" msgstr "Nivel inicial" #. Default: "Title" -#: plone/restapi/services/contextnavigation/get.py:48 +#: plone/restapi/services/contextnavigation/get.py:51 msgid "label_navigation_title" msgstr "Título" #. Default: "Navigation tree depth" -#: plone/restapi/services/contextnavigation/get.py:112 +#: plone/restapi/services/contextnavigation/get.py:115 msgid "label_navigation_tree_depth" msgstr "Profundidad del árbol de navegación" diff --git a/src/plone/restapi/locales/fr/LC_MESSAGES/plone.restapi.po b/src/plone/restapi/locales/fr/LC_MESSAGES/plone.restapi.po index 7d1260a51e..958226088e 100644 --- a/src/plone/restapi/locales/fr/LC_MESSAGES/plone.restapi.po +++ b/src/plone/restapi/locales/fr/LC_MESSAGES/plone.restapi.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2022-12-29 15:58+0000\n" +"POT-Creation-Date: 2023-09-21 15:17+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: Julien Chandelle \n" "Language-Team: French \n" @@ -14,11 +14,11 @@ msgstr "" "Preferred-Encodings: utf-8 latin1\n" "Domain: plone.restapi\n" -#: plone/restapi/services/email_send/post.py:81 +#: plone/restapi/services/email_send/post.py:88 msgid "${sender_fullname} via ${portal_title}" msgstr "${sender_fullname} via ${portal_title}" -#: plone/restapi/services/email_send/post.py:74 +#: plone/restapi/services/email_send/post.py:81 msgid "A portal user via ${portal_title}" msgstr "Un utilisateur du portail via ${portal_title}" @@ -34,23 +34,23 @@ msgstr "" msgid "Adds sample workflows for testing" msgstr "" -#: plone/restapi/services/aliases/add.py:106 +#: plone/restapi/services/aliases/add.py:107 msgid "Alternative urls that point to themselves will cause an endless cycle of redirects." msgstr "Les URLs alternatives qui pointent vers elles-mêmes provoqueront un cycle sans fin de redirections." -#: plone/restapi/configure.zcml:115 +#: plone/restapi/configure.zcml:116 msgid "Blocks" msgstr "Blocs" -#: plone/restapi/configure.zcml:122 +#: plone/restapi/configure.zcml:123 msgid "Blocks (Editable Layout)" msgstr "Blocs (mise en page modifiable)" -#: plone/restapi/configure.zcml:122 +#: plone/restapi/configure.zcml:123 msgid "Enables Volto Blocks (editable layout) support" msgstr "Active la prise en charge des blocs Volto (mise en page modifiable)" -#: plone/restapi/configure.zcml:115 +#: plone/restapi/configure.zcml:116 msgid "Enables Volto Blocks support" msgstr "Active la prise en charge des blocs Volto" @@ -58,7 +58,7 @@ msgstr "Active la prise en charge des blocs Volto" msgid "Enables blocks on the Document content type" msgstr "" -#: plone/restapi/services/contextnavigation/get.py:133 +#: plone/restapi/services/contextnavigation/get.py:136 msgid "Enter a valid scale name (see 'Image Handling' control panel) to override (e.g. icon, tile, thumb, mini, preview, ... ). Leave empty to use default (see 'Site' control panel)." msgstr "Saisissez un nom d'échelle valide (cf. « Gestion des images » dans le panneau de configuration) pour outrepasser (p. ex. icon, tile, thumb, mini, preview, etc.). Laisser vide pour utiliser les échelles par défaut (cf. « Site » dans le panneau de configuration)." @@ -67,15 +67,15 @@ msgid "Error in fields. ${errors_to_string}" msgstr "Erreur dans les champs. ${errors_to_string}" #. Default: "The reset_token is expired." -#: plone/restapi/services/users/add.py:312 +#: plone/restapi/services/users/add.py:319 msgid "Expired Token" msgstr "Le reset_token a expiré" -#: plone/restapi/services/contextnavigation/get.py:126 +#: plone/restapi/services/contextnavigation/get.py:129 msgid "If enabled, the portlet will not show document type icons." msgstr "Si activé, le portlet n'affichera pas les icônes de types de documents." -#: plone/restapi/services/contextnavigation/get.py:145 +#: plone/restapi/services/contextnavigation/get.py:148 msgid "If enabled, the portlet will not show thumbs." msgstr "Si activé, le portlet n'affichera pas les miniatures." @@ -91,11 +91,11 @@ msgstr "Si vous passez le paramètre 'reset_token', vous devez passer le paramè msgid "Layout" msgstr "Mise en page" -#: plone/restapi/services/contextnavigation/get.py:195 +#: plone/restapi/services/contextnavigation/get.py:197 msgid "Navigation" msgstr "Navigation" -#: plone/restapi/services/contextnavigation/get.py:132 +#: plone/restapi/services/contextnavigation/get.py:135 msgid "Override thumb scale" msgstr "Remplacer l'échelle de miniature" @@ -123,23 +123,23 @@ msgstr "Retour à la révision ${version}" msgid "Roles" msgstr "Rôles" -#: plone/restapi/services/users/add.py:350 +#: plone/restapi/services/users/add.py:357 msgid "See the user endpoint documentation for the valid parameters." msgstr "Consultez la documentation du endpoint user pour les paramètres valides." -#: plone/restapi/services/contextnavigation/get.py:125 +#: plone/restapi/services/contextnavigation/get.py:128 msgid "Suppress Icons" msgstr "Supprimer les icônes" -#: plone/restapi/services/contextnavigation/get.py:144 +#: plone/restapi/services/contextnavigation/get.py:147 msgid "Suppress thumbs" msgstr "Supprimer les miniatures" -#: plone/restapi/services/users/add.py:342 +#: plone/restapi/services/users/add.py:349 msgid "The password passed as 'old_password' is wrong." msgstr "Le mot de passe passé comme 'old_password' est erroné." -#: plone/restapi/services/users/add.py:307 +#: plone/restapi/services/users/add.py:314 msgid "The reset_token is unknown/not valid." msgstr "Le reset_token est inconnu/non valide." @@ -147,11 +147,11 @@ msgstr "Le reset_token est inconnu/non valide." msgid "Volto Blocks" msgstr "Blocs Volto" -#: plone/restapi/services/users/update.py:119 +#: plone/restapi/services/users/update.py:139 msgid "You are not authorized to perform this action" msgstr "Vous n'êtes pas autorisé à effectuer cette action" -#: plone/restapi/services/email_send/post.py:91 +#: plone/restapi/services/email_send/post.py:98 msgid "You are receiving this mail because ${sender_fullname} sent this message via the site ${portal_title}:" msgstr "Vous recevez cette e-mail, car ${sender_fullname} vous a envoyé ce message depuis ${portal_title}:" @@ -159,11 +159,15 @@ msgstr "Vous recevez cette e-mail, car ${sender_fullname} vous a envoyé ce mess msgid "You can't send both password and sendPasswordReset." msgstr "Vous ne pouvez pas envoyer à la fois le password et sendPasswordReset" -#: plone/restapi/services/users/add.py:322 +#: plone/restapi/services/users/add.py:329 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:125 +#: plone/restapi/services/users/update.py:108 +msgid "You can't update roles of this user" +msgstr "" + +#: plone/restapi/services/users/update.py:145 msgid "You can't update the properties of this user" msgstr "Vous ne pouvez pas mettre à jour les propriétés de cet utilisateur" @@ -179,72 +183,72 @@ msgstr "Vous devez soit saisir un password ou sendPasswordReset" msgid "You need AddPortalMember permission." msgstr "Vous avez besoin de la permission AddPortalMember" -#: plone/restapi/services/users/add.py:329 +#: plone/restapi/services/users/add.py:336 msgid "You need to be logged in as the user '${username}' to set the password." msgstr "Vous devez être connecté an tant que '${username}' pour définir le mot de passe." #. Default: "Missing dependency" -#: plone/restapi/services/addons/addons.py:207 +#: plone/restapi/services/addons/addons.py:212 msgid "dependency_missing" msgstr "Dépendence manquante" #. Default: "If selected, the navigation tree will only show the current folder and its children at all times." -#: plone/restapi/services/contextnavigation/get.py:84 +#: plone/restapi/services/contextnavigation/get.py:87 msgid "help_current_folder_only" msgstr "Si cette option est sélectionnée, l'arborescence de navigation n'affichera à tout moment que le dossier actuel et ses enfants." #. Default: "Whether or not to show the top, or 'root', node in the navigation tree. This is affected by the 'Start level' setting." -#: plone/restapi/services/contextnavigation/get.py:69 +#: plone/restapi/services/contextnavigation/get.py:72 msgid "help_include_top_node" msgstr "Afficher ou non le nœud supérieur ou 'racine' dans l'arborescence de navigation. Ceci est affecté par le paramètre 'Niveau de démarrage'." #. Default: "You may search for and choose a folder to act as the root of the navigation tree. Leave blank to use the Plone site root." -#: plone/restapi/services/contextnavigation/get.py:58 +#: plone/restapi/services/contextnavigation/get.py:61 msgid "help_navigation_root" msgstr "Vous pouvez rechercher et choisir un dossier qui servira de racine à l'arborescence de navigation. Laissez vide pour utiliser la racine du site Plone." #. Default: "An integer value that specifies the number of folder levels below the site root that must be exceeded before the navigation tree will display. 0 means that the navigation tree should be displayed everywhere including pages in the root of the site. 1 means the tree only shows up inside folders located in the root and downwards, never showing at the top level." -#: plone/restapi/services/contextnavigation/get.py:96 +#: plone/restapi/services/contextnavigation/get.py:99 msgid "help_navigation_start_level" msgstr "Une nombre entière qui spécifie le nombre de niveaux de dossier sous la racine du site qui doit être dépassé avant que l'arborescence de navigation s'affiche. 0 signifie que l'arborescence de navigation doit être affichée partout, en ce compris les pages à la racine du site. 1 signifie que l'arborescence n'apparaît qu'à l'intérieur des dossiers situés à la racine et en dessous, sans jamais s'afficher au niveau supérieur." #. Default: "The title of the navigation tree." -#: plone/restapi/services/contextnavigation/get.py:49 +#: plone/restapi/services/contextnavigation/get.py:52 msgid "help_navigation_title" msgstr "Titre de l'arborescence de navigation." #. Default: "How many folders should be included before the navigation tree stops. 0 means no limit. 1 only includes the root folder." -#: plone/restapi/services/contextnavigation/get.py:113 +#: plone/restapi/services/contextnavigation/get.py:116 msgid "help_navigation_tree_depth" msgstr "Combien de dossiers doivent être inclus avant que l'arborescence de navigation ne s'arrête. 0 signifie aucune limite. 1 inclut uniquement le dossier racine." #. Default: "Only show the contents of the current folder." -#: plone/restapi/services/contextnavigation/get.py:80 +#: plone/restapi/services/contextnavigation/get.py:83 msgid "label_current_folder_only" msgstr "Afficher uniquement le contenu du dossier actuel." #. Default: "Include top node" -#: plone/restapi/services/contextnavigation/get.py:68 +#: plone/restapi/services/contextnavigation/get.py:71 msgid "label_include_top_node" msgstr "Inclure le nœud supérieur" #. Default: "Root node" -#: plone/restapi/services/contextnavigation/get.py:57 +#: plone/restapi/services/contextnavigation/get.py:60 msgid "label_navigation_root_path" msgstr "Noeud principal" #. Default: "Start level" -#: plone/restapi/services/contextnavigation/get.py:95 +#: plone/restapi/services/contextnavigation/get.py:98 msgid "label_navigation_startlevel" msgstr "Niveau de démarrage" #. Default: "Title" -#: plone/restapi/services/contextnavigation/get.py:48 +#: plone/restapi/services/contextnavigation/get.py:51 msgid "label_navigation_title" msgstr "Titre" #. Default: "Navigation tree depth" -#: plone/restapi/services/contextnavigation/get.py:112 +#: plone/restapi/services/contextnavigation/get.py:115 msgid "label_navigation_tree_depth" msgstr "Profondeur de l'arborescence de navigation" diff --git a/src/plone/restapi/locales/plone.restapi.pot b/src/plone/restapi/locales/plone.restapi.pot index 17bca71cfe..1b5dc2428e 100644 --- a/src/plone/restapi/locales/plone.restapi.pot +++ b/src/plone/restapi/locales/plone.restapi.pot @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2022-12-29 15:58+0000\n" +"POT-Creation-Date: 2023-09-21 15:17+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,11 +17,11 @@ msgstr "" "Preferred-Encodings: utf-8 latin1\n" "Domain: plone.restapi\n" -#: plone/restapi/services/email_send/post.py:81 +#: plone/restapi/services/email_send/post.py:88 msgid "${sender_fullname} via ${portal_title}" msgstr "" -#: plone/restapi/services/email_send/post.py:74 +#: plone/restapi/services/email_send/post.py:81 msgid "A portal user via ${portal_title}" msgstr "" @@ -37,23 +37,23 @@ msgstr "" msgid "Adds sample workflows for testing" msgstr "" -#: plone/restapi/services/aliases/add.py:106 +#: plone/restapi/services/aliases/add.py:107 msgid "Alternative urls that point to themselves will cause an endless cycle of redirects." msgstr "" -#: plone/restapi/configure.zcml:115 +#: plone/restapi/configure.zcml:116 msgid "Blocks" msgstr "" -#: plone/restapi/configure.zcml:122 +#: plone/restapi/configure.zcml:123 msgid "Blocks (Editable Layout)" msgstr "" -#: plone/restapi/configure.zcml:122 +#: plone/restapi/configure.zcml:123 msgid "Enables Volto Blocks (editable layout) support" msgstr "" -#: plone/restapi/configure.zcml:115 +#: plone/restapi/configure.zcml:116 msgid "Enables Volto Blocks support" msgstr "" @@ -61,7 +61,7 @@ msgstr "" msgid "Enables blocks on the Document content type" msgstr "" -#: plone/restapi/services/contextnavigation/get.py:133 +#: plone/restapi/services/contextnavigation/get.py:136 msgid "Enter a valid scale name (see 'Image Handling' control panel) to override (e.g. icon, tile, thumb, mini, preview, ... ). Leave empty to use default (see 'Site' control panel)." msgstr "" @@ -70,15 +70,15 @@ msgid "Error in fields. ${errors_to_string}" msgstr "" #. Default: "The reset_token is expired." -#: plone/restapi/services/users/add.py:312 +#: plone/restapi/services/users/add.py:319 msgid "Expired Token" msgstr "" -#: plone/restapi/services/contextnavigation/get.py:126 +#: plone/restapi/services/contextnavigation/get.py:129 msgid "If enabled, the portlet will not show document type icons." msgstr "" -#: plone/restapi/services/contextnavigation/get.py:145 +#: plone/restapi/services/contextnavigation/get.py:148 msgid "If enabled, the portlet will not show thumbs." msgstr "" @@ -94,11 +94,11 @@ msgstr "" msgid "Layout" msgstr "" -#: plone/restapi/services/contextnavigation/get.py:195 +#: plone/restapi/services/contextnavigation/get.py:197 msgid "Navigation" msgstr "" -#: plone/restapi/services/contextnavigation/get.py:132 +#: plone/restapi/services/contextnavigation/get.py:135 msgid "Override thumb scale" msgstr "" @@ -126,23 +126,23 @@ msgstr "" msgid "Roles" msgstr "" -#: plone/restapi/services/users/add.py:350 +#: plone/restapi/services/users/add.py:357 msgid "See the user endpoint documentation for the valid parameters." msgstr "" -#: plone/restapi/services/contextnavigation/get.py:125 +#: plone/restapi/services/contextnavigation/get.py:128 msgid "Suppress Icons" msgstr "" -#: plone/restapi/services/contextnavigation/get.py:144 +#: plone/restapi/services/contextnavigation/get.py:147 msgid "Suppress thumbs" msgstr "" -#: plone/restapi/services/users/add.py:342 +#: plone/restapi/services/users/add.py:349 msgid "The password passed as 'old_password' is wrong." msgstr "" -#: plone/restapi/services/users/add.py:307 +#: plone/restapi/services/users/add.py:314 msgid "The reset_token is unknown/not valid." msgstr "" @@ -150,11 +150,11 @@ msgstr "" msgid "Volto Blocks" msgstr "" -#: plone/restapi/services/users/update.py:119 +#: plone/restapi/services/users/update.py:139 msgid "You are not authorized to perform this action" msgstr "" -#: plone/restapi/services/email_send/post.py:91 +#: plone/restapi/services/email_send/post.py:98 msgid "You are receiving this mail because ${sender_fullname} sent this message via the site ${portal_title}:" msgstr "" @@ -162,11 +162,15 @@ msgstr "" msgid "You can't send both password and sendPasswordReset." msgstr "" -#: plone/restapi/services/users/add.py:322 +#: plone/restapi/services/users/add.py:329 msgid "You can't set a password without a password reset token." msgstr "" -#: plone/restapi/services/users/update.py:125 +#: plone/restapi/services/users/update.py:108 +msgid "You can't update roles of this user" +msgstr "" + +#: plone/restapi/services/users/update.py:145 msgid "You can't update the properties of this user" msgstr "" @@ -182,72 +186,72 @@ msgstr "" msgid "You need AddPortalMember permission." msgstr "" -#: plone/restapi/services/users/add.py:329 +#: plone/restapi/services/users/add.py:336 msgid "You need to be logged in as the user '${username}' to set the password." msgstr "" #. Default: "Missing dependency" -#: plone/restapi/services/addons/addons.py:207 +#: plone/restapi/services/addons/addons.py:212 msgid "dependency_missing" msgstr "" #. Default: "If selected, the navigation tree will only show the current folder and its children at all times." -#: plone/restapi/services/contextnavigation/get.py:84 +#: plone/restapi/services/contextnavigation/get.py:87 msgid "help_current_folder_only" msgstr "" #. Default: "Whether or not to show the top, or 'root', node in the navigation tree. This is affected by the 'Start level' setting." -#: plone/restapi/services/contextnavigation/get.py:69 +#: plone/restapi/services/contextnavigation/get.py:72 msgid "help_include_top_node" msgstr "" #. Default: "You may search for and choose a folder to act as the root of the navigation tree. Leave blank to use the Plone site root." -#: plone/restapi/services/contextnavigation/get.py:58 +#: plone/restapi/services/contextnavigation/get.py:61 msgid "help_navigation_root" msgstr "" #. Default: "An integer value that specifies the number of folder levels below the site root that must be exceeded before the navigation tree will display. 0 means that the navigation tree should be displayed everywhere including pages in the root of the site. 1 means the tree only shows up inside folders located in the root and downwards, never showing at the top level." -#: plone/restapi/services/contextnavigation/get.py:96 +#: plone/restapi/services/contextnavigation/get.py:99 msgid "help_navigation_start_level" msgstr "" #. Default: "The title of the navigation tree." -#: plone/restapi/services/contextnavigation/get.py:49 +#: plone/restapi/services/contextnavigation/get.py:52 msgid "help_navigation_title" msgstr "" #. Default: "How many folders should be included before the navigation tree stops. 0 means no limit. 1 only includes the root folder." -#: plone/restapi/services/contextnavigation/get.py:113 +#: plone/restapi/services/contextnavigation/get.py:116 msgid "help_navigation_tree_depth" msgstr "" #. Default: "Only show the contents of the current folder." -#: plone/restapi/services/contextnavigation/get.py:80 +#: plone/restapi/services/contextnavigation/get.py:83 msgid "label_current_folder_only" msgstr "" #. Default: "Include top node" -#: plone/restapi/services/contextnavigation/get.py:68 +#: plone/restapi/services/contextnavigation/get.py:71 msgid "label_include_top_node" msgstr "" #. Default: "Root node" -#: plone/restapi/services/contextnavigation/get.py:57 +#: plone/restapi/services/contextnavigation/get.py:60 msgid "label_navigation_root_path" msgstr "" #. Default: "Start level" -#: plone/restapi/services/contextnavigation/get.py:95 +#: plone/restapi/services/contextnavigation/get.py:98 msgid "label_navigation_startlevel" msgstr "" #. Default: "Title" -#: plone/restapi/services/contextnavigation/get.py:48 +#: plone/restapi/services/contextnavigation/get.py:51 msgid "label_navigation_title" msgstr "" #. Default: "Navigation tree depth" -#: plone/restapi/services/contextnavigation/get.py:112 +#: plone/restapi/services/contextnavigation/get.py:115 msgid "label_navigation_tree_depth" msgstr "" diff --git a/src/plone/restapi/locales/pt_BR/LC_MESSAGES/plone.restapi.po b/src/plone/restapi/locales/pt_BR/LC_MESSAGES/plone.restapi.po index 1c5afcc61d..79eb245a07 100644 --- a/src/plone/restapi/locales/pt_BR/LC_MESSAGES/plone.restapi.po +++ b/src/plone/restapi/locales/pt_BR/LC_MESSAGES/plone.restapi.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: plone.restapi\n" -"POT-Creation-Date: 2022-12-29 15:58+0000\n" +"POT-Creation-Date: 2023-09-21 15:17+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: Wesley Barroso Lopes\n" "Language-Team: \n" @@ -14,11 +14,11 @@ msgstr "" "Preferred-Encodings: utf-8 latin1\n" "Domain: plone.restapi\n" -#: plone/restapi/services/email_send/post.py:81 +#: plone/restapi/services/email_send/post.py:88 msgid "${sender_fullname} via ${portal_title}" msgstr "" -#: plone/restapi/services/email_send/post.py:74 +#: plone/restapi/services/email_send/post.py:81 msgid "A portal user via ${portal_title}" msgstr "Um usuário do portal via ${portal_title}" @@ -34,23 +34,23 @@ msgstr "Adiciona tipos de conteúdo de amostra para teste" msgid "Adds sample workflows for testing" msgstr "Adiciona workflows de amostra para teste" -#: plone/restapi/services/aliases/add.py:106 +#: plone/restapi/services/aliases/add.py:107 msgid "Alternative urls that point to themselves will cause an endless cycle of redirects." msgstr "URLs alternativas que apontam para si mesmas causarão um ciclo interminável de redirecionamentos." -#: plone/restapi/configure.zcml:115 +#: plone/restapi/configure.zcml:116 msgid "Blocks" msgstr "Blocos" -#: plone/restapi/configure.zcml:122 +#: plone/restapi/configure.zcml:123 msgid "Blocks (Editable Layout)" msgstr "Blocos (Layout Editável)" -#: plone/restapi/configure.zcml:122 +#: plone/restapi/configure.zcml:123 msgid "Enables Volto Blocks (editable layout) support" msgstr "Habilita o suporte a Blocos Volto (layout editável)" -#: plone/restapi/configure.zcml:115 +#: plone/restapi/configure.zcml:116 msgid "Enables Volto Blocks support" msgstr "Habilita o suporte a Blocos Volto" @@ -58,7 +58,7 @@ msgstr "Habilita o suporte a Blocos Volto" msgid "Enables blocks on the Document content type" msgstr "Habilita blocos no tipo de conteúdo Página" -#: plone/restapi/services/contextnavigation/get.py:133 +#: plone/restapi/services/contextnavigation/get.py:136 msgid "Enter a valid scale name (see 'Image Handling' control panel) to override (e.g. icon, tile, thumb, mini, preview, ... ). Leave empty to use default (see 'Site' control panel)." msgstr "Informe um nome de escala válido (ver 'Manipulação de Imagem' no painel de controle) para sobrescrever (por exemplo, icon, tile, thumb, mini, preview…). Deixe em branco para usar o valor padrão (ver 'Site' no painel de controle)." @@ -67,15 +67,15 @@ msgid "Error in fields. ${errors_to_string}" msgstr "Erros em campos. ${errors_to_string}" #. Default: "The reset_token is expired." -#: plone/restapi/services/users/add.py:312 +#: plone/restapi/services/users/add.py:319 msgid "Expired Token" msgstr "Token Expirádo" -#: plone/restapi/services/contextnavigation/get.py:126 +#: plone/restapi/services/contextnavigation/get.py:129 msgid "If enabled, the portlet will not show document type icons." msgstr "Caso ativado, o portlet não mostrará os ícones do tipo de conteúdo" -#: plone/restapi/services/contextnavigation/get.py:145 +#: plone/restapi/services/contextnavigation/get.py:148 msgid "If enabled, the portlet will not show thumbs." msgstr "Caso ativado, o portlet não mostrará miniaturas." @@ -91,11 +91,11 @@ msgstr "Se você informar 'Redefinir Token' você deve informar 'Nova Senha'" msgid "Layout" msgstr "Layout" -#: plone/restapi/services/contextnavigation/get.py:195 +#: plone/restapi/services/contextnavigation/get.py:197 msgid "Navigation" msgstr "Navegação" -#: plone/restapi/services/contextnavigation/get.py:132 +#: plone/restapi/services/contextnavigation/get.py:135 msgid "Override thumb scale" msgstr "Sobrescrever a escala da miniatura" @@ -123,23 +123,23 @@ msgstr "Revertido para revisão ${version}" msgid "Roles" msgstr "Papéis" -#: plone/restapi/services/users/add.py:350 +#: plone/restapi/services/users/add.py:357 msgid "See the user endpoint documentation for the valid parameters." msgstr "Consulte a documentação do endpoint user para obter os parâmetros válidos." -#: plone/restapi/services/contextnavigation/get.py:125 +#: plone/restapi/services/contextnavigation/get.py:128 msgid "Suppress Icons" msgstr "Suprimir ícones" -#: plone/restapi/services/contextnavigation/get.py:144 +#: plone/restapi/services/contextnavigation/get.py:147 msgid "Suppress thumbs" msgstr "Suprimir miniaturas" -#: plone/restapi/services/users/add.py:342 +#: plone/restapi/services/users/add.py:349 msgid "The password passed as 'old_password' is wrong." msgstr "A Senha passada como 'Senha Antiga' não é válida." -#: plone/restapi/services/users/add.py:307 +#: plone/restapi/services/users/add.py:314 msgid "The reset_token is unknown/not valid." msgstr "O reset_token é desconhecido/inválido." @@ -147,11 +147,11 @@ msgstr "O reset_token é desconhecido/inválido." msgid "Volto Blocks" msgstr "Blocos Volto" -#: plone/restapi/services/users/update.py:119 +#: plone/restapi/services/users/update.py:139 msgid "You are not authorized to perform this action" msgstr "Você não está autorizado a realizar esta ação" -#: plone/restapi/services/email_send/post.py:91 +#: plone/restapi/services/email_send/post.py:98 msgid "You are receiving this mail because ${sender_fullname} sent this message via the site ${portal_title}:" msgstr "Você está recebendo este e-mail porque ${sender_fullname} enviou esta mensagem através do site ${portal_title}:" @@ -159,11 +159,15 @@ msgstr "Você está recebendo este e-mail porque ${sender_fullname} enviou esta msgid "You can't send both password and sendPasswordReset." msgstr "Você não pode informar Senha e 'Envie um e-mail de confirmação com um link para definir a senha'." -#: plone/restapi/services/users/add.py:322 +#: plone/restapi/services/users/add.py:329 msgid "You can't set a password without a password reset token." msgstr "Você não pode definir uma senha sem um token de redefinição de senha." -#: plone/restapi/services/users/update.py:125 +#: plone/restapi/services/users/update.py:108 +msgid "You can't update roles of this user" +msgstr "Você não pode atualizar os papéis deste usuário" + +#: plone/restapi/services/users/update.py:145 msgid "You can't update the properties of this user" msgstr "Você não pode atualizar as propriedades deste usuário" @@ -179,72 +183,72 @@ msgstr "Você deve informar uma Senha ou 'Envie um e-mail de confirmação com u msgid "You need AddPortalMember permission." msgstr "Você precisa da permissão AddPortalMember." -#: plone/restapi/services/users/add.py:329 +#: plone/restapi/services/users/add.py:336 msgid "You need to be logged in as the user '${username}' to set the password." msgstr "Você precisa estar logado como o usuário '${username}' para definir a senha." #. Default: "Missing dependency" -#: plone/restapi/services/addons/addons.py:207 +#: plone/restapi/services/addons/addons.py:212 msgid "dependency_missing" msgstr "Dependência ausente" #. Default: "If selected, the navigation tree will only show the current folder and its children at all times." -#: plone/restapi/services/contextnavigation/get.py:84 +#: plone/restapi/services/contextnavigation/get.py:87 msgid "help_current_folder_only" msgstr "Caso selecionado, a árvore de navegação irá sempre mostrar somente a pasta atual e seus filhos." #. Default: "Whether or not to show the top, or 'root', node in the navigation tree. This is affected by the 'Start level' setting." -#: plone/restapi/services/contextnavigation/get.py:69 +#: plone/restapi/services/contextnavigation/get.py:72 msgid "help_include_top_node" msgstr "Se o nodo topo, ou 'raiz', deve ser ou não exibido na árvore de navegação. Isso é afetado pela configuração do 'Nível inicial'." #. Default: "You may search for and choose a folder to act as the root of the navigation tree. Leave blank to use the Plone site root." -#: plone/restapi/services/contextnavigation/get.py:58 +#: plone/restapi/services/contextnavigation/get.py:61 msgid "help_navigation_root" msgstr "Você pode procurar por e selecionar uma pasta para agir como a raiz da árvore de navegação. Deixe em branco para usar a raiz do site Plone." #. Default: "An integer value that specifies the number of folder levels below the site root that must be exceeded before the navigation tree will display. 0 means that the navigation tree should be displayed everywhere including pages in the root of the site. 1 means the tree only shows up inside folders located in the root and downwards, never showing at the top level." -#: plone/restapi/services/contextnavigation/get.py:96 +#: plone/restapi/services/contextnavigation/get.py:99 msgid "help_navigation_start_level" msgstr "Um valor inteiro que especifica o número de níveis de pastas abaixo da raiz do site que deve ser excedido antes que a árvore de navegação seja mostrada. 0 significa que a árvore de navegação deve ser mostrada em qualquer lugar, incluindo páginas na raiz do site. 1 significa que a árvore somente aparecerá dentro de pastas localizadas na raiz e abaixo delas, nunca aparecendo no nível raiz." #. Default: "The title of the navigation tree." -#: plone/restapi/services/contextnavigation/get.py:49 +#: plone/restapi/services/contextnavigation/get.py:52 msgid "help_navigation_title" msgstr "O título da árvore de navegação." #. Default: "How many folders should be included before the navigation tree stops. 0 means no limit. 1 only includes the root folder." -#: plone/restapi/services/contextnavigation/get.py:113 +#: plone/restapi/services/contextnavigation/get.py:116 msgid "help_navigation_tree_depth" msgstr "Quantas pastas devem ser incluídas antes que a árvore de navegação pare. 0 significa sem limite. 1 significa incluir somente a pasta raiz." #. Default: "Only show the contents of the current folder." -#: plone/restapi/services/contextnavigation/get.py:80 +#: plone/restapi/services/contextnavigation/get.py:83 msgid "label_current_folder_only" msgstr "Apenas exibir o conteúdo da pasta atual." #. Default: "Include top node" -#: plone/restapi/services/contextnavigation/get.py:68 +#: plone/restapi/services/contextnavigation/get.py:71 msgid "label_include_top_node" msgstr "Incluir o nodo topo" #. Default: "Root node" -#: plone/restapi/services/contextnavigation/get.py:57 +#: plone/restapi/services/contextnavigation/get.py:60 msgid "label_navigation_root_path" msgstr "Nodo raiz" #. Default: "Start level" -#: plone/restapi/services/contextnavigation/get.py:95 +#: plone/restapi/services/contextnavigation/get.py:98 msgid "label_navigation_startlevel" msgstr "Nível inicial" #. Default: "Title" -#: plone/restapi/services/contextnavigation/get.py:48 +#: plone/restapi/services/contextnavigation/get.py:51 msgid "label_navigation_title" msgstr "Título" #. Default: "Navigation tree depth" -#: plone/restapi/services/contextnavigation/get.py:112 +#: plone/restapi/services/contextnavigation/get.py:115 msgid "label_navigation_tree_depth" msgstr "Profundidade da árvore de navegação" diff --git a/src/plone/restapi/services/users/update.py b/src/plone/restapi/services/users/update.py index 6fdcb20c4b..37287c6018 100644 --- a/src/plone/restapi/services/users/update.py +++ b/src/plone/restapi/services/users/update.py @@ -5,6 +5,7 @@ from plone.restapi import _ from plone.restapi.bbb import ISecuritySchema from plone.restapi.services import Service +from Products.CMFCore.permissions import ManagePortal from Products.CMFCore.permissions import SetOwnPassword from Products.CMFCore.utils import getToolByName from Products.CMFPlone.utils import set_own_login_name @@ -30,6 +31,15 @@ def __init__(self, context, request): super().__init__(context, request) self.params = [] + @property + def is_zope_manager(self): + return getSecurityManager().checkPermission(ManagePortal, self.context) + + def can_change_manager_role(self, target_roles, current_roles): + if self.is_zope_manager: + return True + return "Manager" not in current_roles and list(target_roles) == current_roles + def publishTraverse(self, request, name): # Consume any path segments after /@users as parameters self.params.append(name) @@ -85,9 +95,17 @@ def reply(self): to_add = [key for key, enabled in roles.items() if enabled] to_remove = [key for key, enabled in roles.items() if not enabled] - target_roles = set(user.getRoles()) - set(to_remove) + current_roles = user.getRoles() + target_roles = set(current_roles) - set(to_remove) target_roles = target_roles | set(to_add) + if not self.can_change_manager_role(target_roles, current_roles): + return self._error( + 403, + "Forbidden", + _("You can't update roles of this user"), + ) + acl_users = getToolByName(self.context, "acl_users") acl_users.userFolderEditUser( principal_id=user.id, diff --git a/src/plone/restapi/tests/test_services_users.py b/src/plone/restapi/tests/test_services_users.py index 6de014a8cb..4f1c5b86cb 100644 --- a/src/plone/restapi/tests/test_services_users.py +++ b/src/plone/restapi/tests/test_services_users.py @@ -91,6 +91,20 @@ def makeRealImage(self): with open(path, "rb") as image: yield dummy.FileUpload(dummy.FieldStorage(image)) + def set_siteadm(self): + siteadm_username = "siteadm" + siteadm_password = "siteadmpassword" + api.user.create( + email="siteadm@example.com", + roles=["Site Administrator"], + username=siteadm_username, + password=siteadm_password, + ) + self.api_session = RelativeSession(self.portal_url, test=self) + self.api_session.headers.update({"Accept": "application/json"}) + self.api_session.auth = (siteadm_username, siteadm_password) + transaction.commit() + def test_list_users(self): response = self.api_session.get("/@users") @@ -1301,3 +1315,42 @@ def getMemberById(self, userid): self.assertEqual(len(users), 2) self.assertEqual(users[0].userid, "user1") self.assertEqual(users[1].userid, "user2") + + def test_siteadm_not_update_manager(self): + self.set_siteadm() + payload = { + "roles": { + "Contributor": False, + "Editor": False, + "Reviewer": False, + "Manager": True, + "Member": True, + "Reader": False, + "Site Administrator": False, + } + } + + self.api_session.patch("/@users/noam", json=payload) + transaction.commit() + + noam = api.user.get(userid="noam") + self.assertNotIn("Manager", noam.getRoles()) + + def test_manager_update_manager(self): + payload = { + "roles": { + "Contributor": False, + "Editor": False, + "Reviewer": False, + "Manager": True, + "Member": True, + "Reader": False, + "Site Administrator": False, + } + } + + self.api_session.patch("/@users/noam", json=payload) + transaction.commit() + + noam = api.user.get(userid="noam") + self.assertIn("Manager", noam.getRoles())