public function onBeforeNormalization(BeforeNormalizationEvent $event): void
    {
        $resource = $event->getResource();

        if (!$resource instanceof ActionedResourceInterface) {
            return;
        }

        $actions = $resource->getActions();

        foreach ($actions as $action) {
            if (!$action instanceof SymfonyGrantedAction) {
                continue;
            }

            if (!$this->authorizationChecker->isGranted($action->getAttribute(), $action->getObject())) {
                $resource->removeAction($action);
            }
        }
    }