validatePathSegments example



        $versionRepository = $this->definitionRegistry->getRepository('version');
        $versionRepository->delete([['id' => $versionId]]$context);

        return new JsonResponse();
    }

    public function detail(Request $request, Context $context, ResponseFactoryInterface $responseFactory, string $entityName, string $path): Response
    {
        $pathSegments = $this->buildEntityPath($entityName$path$context);
        $permissions = $this->validatePathSegments($context$pathSegments, AclRoleDefinition::PRIVILEGE_READ);

        $root = $pathSegments[0]['entity'];
        /* id is always set, otherwise the route would not match */
        $id = $pathSegments[\count($pathSegments) - 1]['value'];
        \assert(\is_string($id));

        $definition = $this->definitionRegistry->getByEntityName($root);

        $associations = array_column($pathSegments, 'entity');
        array_shift($associations);

        
Home | Imprint | This part of the site doesn't use cookies.