From 9b41edd8a6d8dffabd29e747bbd889cad6b50a47 Mon Sep 17 00:00:00 2001 From: Elorfin Date: Tue, 20 Dec 2022 12:42:18 +0100 Subject: [PATCH] [Resource] fixes resource open with restrictions --- src/main/core/Controller/ResourceController.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/core/Controller/ResourceController.php b/src/main/core/Controller/ResourceController.php index db344859e0c..32e841d6e8c 100644 --- a/src/main/core/Controller/ResourceController.php +++ b/src/main/core/Controller/ResourceController.php @@ -11,7 +11,6 @@ namespace Claroline\CoreBundle\Controller; -use Claroline\AppBundle\API\Options; use Claroline\AppBundle\API\SerializerProvider; use Claroline\AppBundle\Controller\RequestDecoderTrait; use Claroline\AppBundle\Persistence\ObjectManager; @@ -95,10 +94,8 @@ public function __construct( * * @param int|string $id - the id or slug of the target node (we don't use ParamConverter to support ID and UUID) * @param int $embedded - * - * @return JsonResponse */ - public function openAction($id, $embedded = 0) + public function openAction($id, $embedded = 0): JsonResponse { /** @var ResourceNode $resourceNode */ $resourceNode = $this->om->getRepository(ResourceNode::class)->findOneByUuidOrSlug($id); @@ -140,7 +137,7 @@ public function openAction($id, $embedded = 0) return new JsonResponse([ 'managed' => $isManager, - 'resourceNode' => $this->serializer->serialize($resourceNode, [Options::SERIALIZE_MINIMAL]), + 'resourceNode' => $this->serializer->serialize($resourceNode), 'accessErrors' => $accessErrors, ], $statusCode); }