class ConfigTranslationOverviewAccess implements AccessInterface (View source)

Checks access for displaying the configuration translation overview.

Properties

protected ConfigMapperManagerInterface $configMapperManager

The mapper plugin discovery service.

protected LanguageManagerInterface $languageManager

The language manager.

Methods

__construct(ConfigMapperManagerInterface $config_mapper_manager, LanguageManagerInterface $language_manager)

Constructs a ConfigTranslationOverviewAccess object.

access(RouteMatchInterface $route_match, AccountInterface $account)

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)

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)

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.

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)

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

Grants access if the proper permission is granted to the account, the configuration has translatable pieces, and the source language is not locked given it is present.

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.

Return Value

AccessResultInterface

The result of the access check.