You are here

interface AllowedLanguagesManagerInterface in Allowed Languages 2.x

The allowed language manager controls access to content by language.

@package Drupal\allowed_languages

Hierarchy

Expanded class hierarchy of AllowedLanguagesManagerInterface

All classes that implement AllowedLanguagesManagerInterface

2 files declare their use of AllowedLanguagesManagerInterface
AccessCheckBase.php in src/Access/AccessCheckBase.php
ContentTranslationAccessCheck.php in src/Access/ContentTranslationAccessCheck.php

File

src/AllowedLanguagesManagerInterface.php, line 14

Namespace

Drupal\allowed_languages
View source
interface AllowedLanguagesManagerInterface {

  /**
   * Get the actual account entity behind the proxy.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The account proxy object to use to get the account entity.
   *
   * @return \Drupal\user\UserInterface
   *   The account entity behind the proxy.
   */
  public function accountFromProxy(AccountInterface $account = NULL);

  /**
   * Get the allowed languages for the specified user.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The user to get allowed languages for.
   *
   * @return array
   *   An array of allowed language ids.
   */
  public function assignedLanguages(AccountInterface $account = NULL);

  /**
   * Checks if the user is allowed to translate the specified language.
   *
   * @param \Drupal\Core\Language\LanguageInterface $language
   *   The language to check for.
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The user to check.
   *
   * @return bool
   *   If the user is allowed to or not.
   */
  public function hasPermissionForLanguage(LanguageInterface $language, AccountInterface $account = NULL);

  /**
   * Decide whether the entity should be language controlled or not.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity to test.
   *
   * @return bool
   *   TRUE if the entity should have permissions applied, FALSE otherwise.
   */
  public function isEntityLanguageControlled(EntityInterface $entity);

}

Members

Namesort descending Modifiers Type Description Overrides
AllowedLanguagesManagerInterface::accountFromProxy public function Get the actual account entity behind the proxy. 1
AllowedLanguagesManagerInterface::assignedLanguages public function Get the allowed languages for the specified user. 1
AllowedLanguagesManagerInterface::hasPermissionForLanguage public function Checks if the user is allowed to translate the specified language. 1
AllowedLanguagesManagerInterface::isEntityLanguageControlled public function Decide whether the entity should be language controlled or not. 1