class ContentTranslationManageAccessCheck implements AccessInterface (View source)

Access check for entity translation CRUD operation.

Properties

protected EntityTypeManagerInterface $entityTypeManager

The entity type manager.

protected LanguageManagerInterface $languageManager

The language manager.

Methods

__construct(EntityTypeManagerInterface $entity_type_manager, LanguageManagerInterface $language_manager)

Constructs a ContentTranslationManageAccessCheck object.

access(Route $route, RouteMatchInterface $route_match, AccountInterface $account, string $source = NULL, string $target = NULL, string $language = NULL, string $entity_type_id = NULL)

Checks translation access for the entity and operation on the given route.

checkAccess(ContentEntityInterface $entity, LanguageInterface $language, string $operation)

Performs access checks for the specified operation.

Details

__construct(EntityTypeManagerInterface $entity_type_manager, LanguageManagerInterface $language_manager)

Constructs a ContentTranslationManageAccessCheck object.

Parameters

EntityTypeManagerInterface $entity_type_manager

The entity type manager.

LanguageManagerInterface $language_manager

The language manager.

AccessResultInterface access(Route $route, RouteMatchInterface $route_match, AccountInterface $account, string $source = NULL, string $target = NULL, string $language = NULL, string $entity_type_id = NULL)

Checks translation access for the entity and operation on the given route.

Parameters

Route $route

The route to check against.

RouteMatchInterface $route_match

The parametrized route.

AccountInterface $account

The currently logged in account.

string $source

(optional) For a create operation, the language code of the source.

string $target

(optional) For a create operation, the language code of the translation.

string $language

(optional) For an update or delete operation, the language code of the translation being updated or deleted.

string $entity_type_id

(optional) The entity type ID.

Return Value

AccessResultInterface

The access result.

protected AccessResultInterface checkAccess(ContentEntityInterface $entity, LanguageInterface $language, string $operation)

Performs access checks for the specified operation.

Parameters

ContentEntityInterface $entity

The entity being checked.

LanguageInterface $language

For an update or delete operation, the language code of the translation being updated or deleted.

string $operation

The operation to be checked.

Return Value

AccessResultInterface

An access result object.