diff options
author | Joas Schilling <coding@schilljs.com> | 2021-05-27 14:23:04 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-05-27 23:02:43 +0000 |
commit | 0d9c60613ed146a136a704e6b172a4eb2d3006f1 (patch) | |
tree | d7b6f8f03f092e687ca1e0b60c4bbf58a61ca097 /apps/provisioning_api/lib | |
parent | aaf7250fc69f352945343aa38a7c4064e26613a7 (diff) | |
download | nextcloud-server-0d9c60613ed146a136a704e6b172a4eb2d3006f1.tar.gz nextcloud-server-0d9c60613ed146a136a704e6b172a4eb2d3006f1.zip |
Fix the get editable fields endpoint without a user id
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/provisioning_api/lib')
-rw-r--r-- | apps/provisioning_api/lib/Controller/UsersController.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index b6b9efb078b..155c95d6020 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -531,7 +531,24 @@ class UsersController extends AUserData { * @return DataResponse * @throws OCSException */ - public function getEditableFields(?string $userId = null): DataResponse { + public function getEditableFields(): DataResponse { + $currentLoggedInUser = $this->userSession->getUser(); + if (!$currentLoggedInUser instanceof IUser) { + throw new OCSException('', OCSController::RESPOND_NOT_FOUND); + } + + return $this->getEditableFieldsForUser($currentLoggedInUser->getUID()); + } + + /** + * @NoAdminRequired + * @NoSubAdminRequired + * + * @param string $userId + * @return DataResponse + * @throws OCSException + */ + public function getEditableFieldsForUser(string $userId): DataResponse { $currentLoggedInUser = $this->userSession->getUser(); if (!$currentLoggedInUser instanceof IUser) { throw new OCSException('', \OCP\API::RESPOND_NOT_FOUND); |