class EntityAccessCheck implements AccessInterface (View source)

Provides a generic access checker for entities.

Methods

access(Route $route, RouteMatchInterface $route_match, AccountInterface $account)

Checks access to the entity operation on the given route.

Details

AccessResultInterface access(Route $route, RouteMatchInterface $route_match, AccountInterface $account)

Checks access to the entity operation on the given route.

The route's '_entity_access' requirement must follow the pattern 'entity_stub_name.operation', where available operations are: 'view', 'update', 'create', and 'delete'.

For example, this route configuration invokes a permissions check for 'update' access to entities of type 'node':

Parameters

Route $route

The route to check against.

RouteMatchInterface $route_match

The parametrized route

AccountInterface $account

The currently logged in account.

Return Value

AccessResultInterface

The access result.

See also

EntityConverter