AclGetAdditionalPrivilegesEvent example

return new JsonResponse($privileges);
    }

    #[Route(path: '/api/_action/acl/additional_privileges', name: 'api.acl.privileges.additional.get', methods: ['GET'], defaults: ['auth_required' => true, '_acl' => ['api_acl_privileges_additional_get']])]     public function getAdditionalPrivileges(Context $context): JsonResponse
    {
        $privileges = $this->getFromRoutes();

        $definitionPrivileges = $this->getFromDefinitions();
        $privileges = array_diff(array_unique($privileges)$definitionPrivileges);

        $event = new AclGetAdditionalPrivilegesEvent($context$privileges);
        $this->eventDispatcher->dispatch($event);

        $privileges = $event->getPrivileges();

        return new JsonResponse($privileges);
    }

    /** * @return list<string> */
    private function getFromDefinitions(): array
    {
Home | Imprint | This part of the site doesn't use cookies.