class ConfigTranslationFormAccess extends ConfigTranslationOverviewAccess (View source)

Checks access for displaying the translation add, edit, and delete forms.

Properties

protected ConfigMapperManagerInterface $configMapperManager

The mapper plugin discovery service.

from  ConfigTranslationOverviewAccess
protected LanguageManagerInterface $languageManager

The language manager.

from  ConfigTranslationOverviewAccess

Methods

__construct(ConfigMapperManagerInterface $config_mapper_manager, LanguageManagerInterface $language_manager)

Constructs a ConfigTranslationOverviewAccess object.

access(RouteMatchInterface $route_match, AccountInterface $account, string $langcode = NULL)

Checks access to the overview based on permissions and translatability.

getMapperFromRouteMatch(RouteMatchInterface $route_match)

Gets a configuration mapper using a route match.

doCheckAccess(AccountInterface $account, ConfigMapperInterface $mapper, LanguageInterface|null $source_language = NULL, LanguageInterface|null $target_language = NULL)

Checks access given an account, configuration mapper, and source language.

Details

__construct(ConfigMapperManagerInterface $config_mapper_manager, LanguageManagerInterface $language_manager)

Constructs a ConfigTranslationOverviewAccess object.

Parameters

ConfigMapperManagerInterface $config_mapper_manager

The mapper plugin discovery service.

LanguageManagerInterface $language_manager

The language manager service.

AccessResultInterface access(RouteMatchInterface $route_match, AccountInterface $account, string $langcode = NULL)

Checks access to the overview based on permissions and translatability.

Parameters

RouteMatchInterface $route_match

The route_match to check against.

AccountInterface $account

The account to check access for.

string $langcode

The language code of the target language.

Return Value

AccessResultInterface

The access result.

protected ConfigMapperInterface getMapperFromRouteMatch(RouteMatchInterface $route_match)

Gets a configuration mapper using a route match.

Parameters

RouteMatchInterface $route_match

The route match to populate the mapper with.

Return Value

ConfigMapperInterface

The configuration mapper.

protected AccessResultInterface doCheckAccess(AccountInterface $account, ConfigMapperInterface $mapper, LanguageInterface|null $source_language = NULL, LanguageInterface|null $target_language = NULL)

Checks access given an account, configuration mapper, and source language.

In addition to the checks performed by ConfigTranslationOverviewAccess::doCheckAccess() this makes sure the target language is not locked and the target language is not the source language.

Although technically configuration can be overlaid with translations in the same language, that is logically not a good idea.

Parameters

AccountInterface $account

The account to check access for.

ConfigMapperInterface $mapper

The configuration mapper to check access for.

LanguageInterface|null $source_language

The source language to check for, if any.

LanguageInterface|null $target_language

The target language to check for, if any.

Return Value

AccessResultInterface

The result of the access check.

See also

ConfigTranslationOverviewAccess::doCheckAccess