interface AuthorizerInterface

Authorizer interface.

Methods

registerPolicy(string $entityClass, string $policyClass)

Registers an authorization policy.

bool
can(UserEntityInterface|null $user, string $action, object|string $entity, mixed ...$parameters)

Returns TRUE if the user is allowed to perform the action on the entity.

Details

at line 25
registerPolicy(string $entityClass, string $policyClass)

Registers an authorization policy.

Parameters

string $entityClass Entity class
string $policyClass Policy class

at line 36
bool can(UserEntityInterface|null $user, string $action, object|string $entity, mixed ...$parameters)

Returns TRUE if the user is allowed to perform the action on the entity.

Parameters

UserEntityInterface|null $user User entity
string $action Action
object|string $entity Entity instance or class name
mixed ...$parameters Additional parameters

Return Value

bool