class LatestRevisionCheck implements AccessInterface (View source)

Access check for the entity moderation tab.

Properties

protected ModerationInformationInterface $moderationInfo

The moderation information service.

Methods

__construct(ModerationInformationInterface $moderation_information)

Constructs a new LatestRevisionCheck.

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

Checks that there is a pending revision available.

loadEntity(Route $route, RouteMatchInterface $route_match)

Returns the default revision of the entity this route is for.

Details

__construct(ModerationInformationInterface $moderation_information)

Constructs a new LatestRevisionCheck.

Parameters

ModerationInformationInterface $moderation_information

The moderation information service.

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

Checks that there is a pending revision available.

This checker assumes the presence of an '_entity_access' requirement key in the same form as used by EntityAccessCheck.

Parameters

Route $route

The route to check against.

RouteMatchInterface $route_match

The parametrized route.

AccountInterface $account

The current user account.

Return Value

AccessResultInterface

The access result.

See also

EntityAccessCheck

protected ContentEntityInterface loadEntity(Route $route, RouteMatchInterface $route_match)

Returns the default revision of the entity this route is for.

Parameters

Route $route

The route to check against.

RouteMatchInterface $route_match

The parametrized route.

Return Value

ContentEntityInterface

returns the Entity in question.

Exceptions

AccessException