CommandAclValidationEvent example

$resource = $command->getDefinition()->getParentDefinition()->getEntityName();

                if ($privilege !== AclRoleDefinition::PRIVILEGE_DELETE) {
                    $privilege = $this->getPrivilegeForParentWriteOperation($command$commands);
                }
            }

            if (!$source->isAllowed($resource . ':' . $privilege)) {
                $missingPrivileges[] = $resource . ':' . $privilege;
            }

            $event = new CommandAclValidationEvent($missingPrivileges$source$command);
            $this->eventDispatcher->dispatch($event);
            /** * @var list<string> $missingPrivileges */
            $missingPrivileges = $event->getMissingPrivileges();
        }

        $this->tryToThrow($missingPrivileges);
    }

    /** * @param list<string> $missingPrivileges */
Home | Imprint | This part of the site doesn't use cookies.