From 3fde60db853454fda3b2c82258ae87b6f29f4726 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Thu, 25 Jul 2024 13:14:46 +0200 Subject: refactor(files): Replace security annotations with respective attributes Signed-off-by: provokateurin --- apps/files/lib/Controller/TransferOwnershipController.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'apps/files/lib/Controller/TransferOwnershipController.php') diff --git a/apps/files/lib/Controller/TransferOwnershipController.php b/apps/files/lib/Controller/TransferOwnershipController.php index 924c200f375..a71373baae4 100644 --- a/apps/files/lib/Controller/TransferOwnershipController.php +++ b/apps/files/lib/Controller/TransferOwnershipController.php @@ -13,6 +13,7 @@ use OCA\Files\Db\TransferOwnership as TransferOwnershipEntity; use OCA\Files\Db\TransferOwnershipMapper; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\Attribute\NoAdminRequired; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCSController; use OCP\AppFramework\Utility\ITimeFactory; @@ -62,8 +63,6 @@ class TransferOwnershipController extends OCSController { /** - * @NoAdminRequired - * * Transfer the ownership to another user * * @param string $recipient Username of the recipient @@ -75,6 +74,7 @@ class TransferOwnershipController extends OCSController { * 400: Transferring ownership is not possible * 403: Transferring ownership is not allowed */ + #[NoAdminRequired] public function transfer(string $recipient, string $path): DataResponse { $recipientUser = $this->userManager->get($recipient); @@ -118,8 +118,6 @@ class TransferOwnershipController extends OCSController { } /** - * @NoAdminRequired - * * Accept an ownership transfer * * @param int $id ID of the ownership transfer @@ -130,6 +128,7 @@ class TransferOwnershipController extends OCSController { * 403: Accepting ownership transfer is not allowed * 404: Ownership transfer not found */ + #[NoAdminRequired] public function accept(int $id): DataResponse { try { $transferOwnership = $this->mapper->getById($id); @@ -161,8 +160,6 @@ class TransferOwnershipController extends OCSController { } /** - * @NoAdminRequired - * * Reject an ownership transfer * * @param int $id ID of the ownership transfer @@ -173,6 +170,7 @@ class TransferOwnershipController extends OCSController { * 403: Rejecting ownership transfer is not allowed * 404: Ownership transfer not found */ + #[NoAdminRequired] public function reject(int $id): DataResponse { try { $transferOwnership = $this->mapper->getById($id); -- cgit v1.2.3