retour null -> 404 (anti-enumeration, coherent avec le detail * Provider). La decision de scope est deleguee a ProviderSiteScopeChecker (source * unique partagee avec le ProviderProvider et les processors). * * @implements ProviderInterface */ final class ProviderSubResourceItemProvider implements ProviderInterface { public function __construct( #[Autowire(service: 'api_platform.doctrine.orm.state.item_provider')] private readonly ProviderInterface $itemProvider, private readonly ProviderSiteScopeChecker $scopeChecker, ) {} public function provide(Operation $operation, array $uriVariables = [], array $context = []): ?object { $entity = $this->itemProvider->provide($operation, $uriVariables, $context); if ($entity instanceof ProviderOwnedInterface) { $parent = $entity->getProvider(); if (null === $parent || !$this->scopeChecker->isInScope($parent)) { return null; } } return $entity; } }