diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index b4f21248e72..dfb45360ad0 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -915,6 +915,11 @@ class UsersController extends AUserDataOCSController { * @param string|null $manager Manager user ID (null = no change, '' = clear) * @param list|null $groups Group IDs to assign (null = no change, [] = remove all) * @param list|null $subadminGroups Subadmin group IDs (null = no change, [] = remove all) + * @return DataResponse|DataResponse}, array{}> + * @throws OCSException + * + * 200: User updated successfully + * 422: One or more submitted fields failed validation */ #[PasswordConfirmationRequired] #[NoAdminRequired] @@ -1133,7 +1138,9 @@ class UsersController extends AUserDataOCSController { } } - return new DataResponse($this->getUserData($userId)); + /** @var Provisioning_APIUserDetails $data */ + $data = $this->getUserData($userId); + return new DataResponse($data); } /** diff --git a/apps/provisioning_api/openapi-full.json b/apps/provisioning_api/openapi-full.json index d08d94c6538..a93843f3f85 100644 --- a/apps/provisioning_api/openapi-full.json +++ b/apps/provisioning_api/openapi-full.json @@ -4566,6 +4566,210 @@ } } }, + "patch": { + "operationId": "users-edit-user-multi-field", + "summary": "Update multiple user account fields atomically. All submitted fields are validated first; if any fail, no changes are applied.", + "description": "Unlike editUser (which updates one field at a time via key/value), this method accepts named fields and applies them all in a single request.\nThis endpoint requires password confirmation", + "tags": [ + "users" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "nullable": true, + "default": null, + "description": "New display name (null = no change)" + }, + "password": { + "type": "string", + "nullable": true, + "default": null, + "description": "New password (null = no change)" + }, + "email": { + "type": "string", + "nullable": true, + "default": null, + "description": "New primary email (null = no change, '' = clear)" + }, + "quota": { + "type": "string", + "nullable": true, + "default": null, + "description": "New quota e.g. \"5 GB\" (null = no change)" + }, + "language": { + "type": "string", + "nullable": true, + "default": null, + "description": "Language code e.g. \"de\" (null = no change)" + }, + "manager": { + "type": "string", + "nullable": true, + "default": null, + "description": "Manager user ID (null = no change, '' = clear)" + }, + "groups": { + "type": "array", + "nullable": true, + "default": null, + "description": "Group IDs to assign (null = no change, [] = remove all)", + "items": { + "type": "string" + } + }, + "subadminGroups": { + "type": "array", + "nullable": true, + "default": null, + "description": "Subadmin group IDs (null = no change, [] = remove all)", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user to update", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "User updated successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/UserDetails" + } + } + } + } + } + } + } + }, + "422": { + "description": "One or more submitted fields failed validation", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "errors" + ], + "properties": { + "errors": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "Current user is not logged in", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": {} + } + } + } + } + } + } + } + } + }, "delete": { "operationId": "users-delete-user", "summary": "Delete a user", diff --git a/apps/provisioning_api/openapi.json b/apps/provisioning_api/openapi.json index eb973f1dd3d..a0567a50914 100644 --- a/apps/provisioning_api/openapi.json +++ b/apps/provisioning_api/openapi.json @@ -2081,6 +2081,210 @@ } } }, + "patch": { + "operationId": "users-edit-user-multi-field", + "summary": "Update multiple user account fields atomically. All submitted fields are validated first; if any fail, no changes are applied.", + "description": "Unlike editUser (which updates one field at a time via key/value), this method accepts named fields and applies them all in a single request.\nThis endpoint requires password confirmation", + "tags": [ + "users" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "nullable": true, + "default": null, + "description": "New display name (null = no change)" + }, + "password": { + "type": "string", + "nullable": true, + "default": null, + "description": "New password (null = no change)" + }, + "email": { + "type": "string", + "nullable": true, + "default": null, + "description": "New primary email (null = no change, '' = clear)" + }, + "quota": { + "type": "string", + "nullable": true, + "default": null, + "description": "New quota e.g. \"5 GB\" (null = no change)" + }, + "language": { + "type": "string", + "nullable": true, + "default": null, + "description": "Language code e.g. \"de\" (null = no change)" + }, + "manager": { + "type": "string", + "nullable": true, + "default": null, + "description": "Manager user ID (null = no change, '' = clear)" + }, + "groups": { + "type": "array", + "nullable": true, + "default": null, + "description": "Group IDs to assign (null = no change, [] = remove all)", + "items": { + "type": "string" + } + }, + "subadminGroups": { + "type": "array", + "nullable": true, + "default": null, + "description": "Subadmin group IDs (null = no change, [] = remove all)", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user to update", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "User updated successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/UserDetails" + } + } + } + } + } + } + } + }, + "422": { + "description": "One or more submitted fields failed validation", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "errors" + ], + "properties": { + "errors": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "Current user is not logged in", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": {} + } + } + } + } + } + } + } + } + }, "delete": { "operationId": "users-delete-user", "summary": "Delete a user", diff --git a/dist/files_sharing-init.js.license b/dist/files_sharing-init.js.license index 809f532878e..ac055ffa676 100644 --- a/dist/files_sharing-init.js.license +++ b/dist/files_sharing-init.js.license @@ -2,7 +2,6 @@ SPDX-License-Identifier: MIT SPDX-License-Identifier: ISC SPDX-License-Identifier: GPL-3.0-or-later SPDX-License-Identifier: BSD-3-Clause -SPDX-License-Identifier: Apache-2.0 SPDX-License-Identifier: AGPL-3.0-or-later SPDX-License-Identifier: (MPL-2.0 OR Apache-2.0) SPDX-FileCopyrightText: webfansplz @@ -40,7 +39,6 @@ SPDX-FileCopyrightText: Eduardo San Martin Morote SPDX-FileCopyrightText: Dr.-Ing. Mario Heiderich, Cure53 (https://cure53.de/) SPDX-FileCopyrightText: David Clark SPDX-FileCopyrightText: Christoph Wurst -SPDX-FileCopyrightText: Austin Andrews SPDX-FileCopyrightText: Anthony Fu SPDX-FileCopyrightText: Anthony Fu SPDX-FileCopyrightText: @nextcloud/dialogs developers @@ -53,9 +51,6 @@ This file is generated from multiple sources. Included packages: - @floating-ui/utils - version: 0.2.11 - license: MIT -- @mdi/svg - - version: 7.4.47 - - license: Apache-2.0 - @nextcloud/auth - version: 2.5.3 - license: GPL-3.0-or-later diff --git a/dist/settings-users-3239.js.license b/dist/settings-users-3239.js.license index d8d6b91b123..2b9386ee50b 100644 --- a/dist/settings-users-3239.js.license +++ b/dist/settings-users-3239.js.license @@ -96,9 +96,6 @@ This file is generated from multiple sources. Included packages: - @mdi/js - version: 7.4.47 - license: Apache-2.0 -- @mdi/svg - - version: 7.4.47 - - license: Apache-2.0 - @nextcloud/auth - version: 2.5.3 - license: GPL-3.0-or-later diff --git a/openapi.json b/openapi.json index 94522cde734..89f48b1e37d 100644 --- a/openapi.json +++ b/openapi.json @@ -32016,6 +32016,210 @@ } } }, + "patch": { + "operationId": "provisioning_api-users-edit-user-multi-field", + "summary": "Update multiple user account fields atomically. All submitted fields are validated first; if any fail, no changes are applied.", + "description": "Unlike editUser (which updates one field at a time via key/value), this method accepts named fields and applies them all in a single request.\nThis endpoint requires password confirmation", + "tags": [ + "provisioning_api/users" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "displayName": { + "type": "string", + "nullable": true, + "default": null, + "description": "New display name (null = no change)" + }, + "password": { + "type": "string", + "nullable": true, + "default": null, + "description": "New password (null = no change)" + }, + "email": { + "type": "string", + "nullable": true, + "default": null, + "description": "New primary email (null = no change, '' = clear)" + }, + "quota": { + "type": "string", + "nullable": true, + "default": null, + "description": "New quota e.g. \"5 GB\" (null = no change)" + }, + "language": { + "type": "string", + "nullable": true, + "default": null, + "description": "Language code e.g. \"de\" (null = no change)" + }, + "manager": { + "type": "string", + "nullable": true, + "default": null, + "description": "Manager user ID (null = no change, '' = clear)" + }, + "groups": { + "type": "array", + "nullable": true, + "default": null, + "description": "Group IDs to assign (null = no change, [] = remove all)", + "items": { + "type": "string" + } + }, + "subadminGroups": { + "type": "array", + "nullable": true, + "default": null, + "description": "Subadmin group IDs (null = no change, [] = remove all)", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "parameters": [ + { + "name": "userId", + "in": "path", + "description": "The user to update", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "description": "Required to be true for the API request to pass", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "responses": { + "200": { + "description": "User updated successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "$ref": "#/components/schemas/ProvisioningApiUserDetails" + } + } + } + } + } + } + } + }, + "422": { + "description": "One or more submitted fields failed validation", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": { + "type": "object", + "required": [ + "errors" + ], + "properties": { + "errors": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "401": { + "description": "Current user is not logged in", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "ocs" + ], + "properties": { + "ocs": { + "type": "object", + "required": [ + "meta", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/OCSMeta" + }, + "data": {} + } + } + } + } + } + } + } + } + }, "delete": { "operationId": "provisioning_api-users-delete-user", "summary": "Delete a user",