Skip to content

Commit

Permalink
[Resource] fixes resource open with restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
Elorfin committed Dec 20, 2022
1 parent 14ce0d3 commit 9b41edd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/core/Controller/ResourceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 9b41edd

Please sign in to comment.