/**
* @return array<string, string|array{0: string, 1: int}|list<array{0: string, 1?: int}>>
*/
public static function getSubscribedEvents(): array
{ return [CommandAclValidationEvent::
class => 'validate'
];
} public function validate(CommandAclValidationEvent
$event): void
{ $command =
$event->
getCommand();
$resource =
$command->
getDefinition()->
getEntityName();
$privilege =
$command->
getPrivilege();
if ($privilege !== AclRoleDefinition::PRIVILEGE_CREATE ||
$resource !== OrderLineItemDefinition::ENTITY_NAME
) { return;
} $payload =
$command->
getPayload();
$type =
$payload['type'
] ?? null;
if ($type !== LineItem::CREDIT_LINE_ITEM_TYPE
) {