You are here

interface ChainGroupPermissionCalculatorInterface in Group 2.0.x

Same name and namespace in other branches
  1. 8 src/Access/ChainGroupPermissionCalculatorInterface.php \Drupal\group\Access\ChainGroupPermissionCalculatorInterface

Runs the added calculators one by one until the full permissions are built.

Each calculator in the chain can be another chain, which is why this interface extends the permission calculator one.

Hierarchy

Expanded class hierarchy of ChainGroupPermissionCalculatorInterface

All classes that implement ChainGroupPermissionCalculatorInterface

4 files declare their use of ChainGroupPermissionCalculatorInterface
EntityQueryAlter.php in src/QueryAccess/EntityQueryAlter.php
GroupPermissionCheckerTest.php in tests/src/Unit/GroupPermissionCheckerTest.php
GroupPermissionHashGeneratorTest.php in tests/src/Unit/GroupPermissionHashGeneratorTest.php
QueryAccessHandlerBase.php in src/Entity/Access/QueryAccessHandlerBase.php

File

src/Access/ChainGroupPermissionCalculatorInterface.php, line 13

Namespace

Drupal\group\Access
View source
interface ChainGroupPermissionCalculatorInterface extends GroupPermissionCalculatorInterface {

  /**
   * Adds a calculator.
   *
   * @param \Drupal\group\Access\GroupPermissionCalculatorInterface $calculator
   *   The calculator.
   *
   * @return mixed
   */
  public function addCalculator(GroupPermissionCalculatorInterface $calculator);

  /**
   * Gets all added calculators.
   *
   * @return \Drupal\group\Access\GroupPermissionCalculatorInterface[]
   *   The calculators.
   */
  public function getCalculators();

  /**
   * Calculates the full group permissions for an authenticated account.
   *
   * This includes both outsider and member permissions.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The user account for which to retrieve the permissions.
   *
   * @return \Drupal\group\Access\CalculatedGroupPermissionsInterface
   *   An object representing the full authenticated group permissions.
   */
  public function calculateAuthenticatedPermissions(AccountInterface $account);

  /**
   * Calculates the full group permissions for an account.
   *
   * This could either include anonymous permissions or both outsider and member
   * permissions, depending on the account's anonymous status.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The user account for which to retrieve the permissions.
   *
   * @return \Drupal\group\Access\CalculatedGroupPermissionsInterface
   *   An object representing the full group permissions.
   */
  public function calculatePermissions(AccountInterface $account);

}

Members

Namesort descending Modifiers Type Description Overrides
ChainGroupPermissionCalculatorInterface::addCalculator public function Adds a calculator. 1
ChainGroupPermissionCalculatorInterface::calculateAuthenticatedPermissions public function Calculates the full group permissions for an authenticated account. 1
ChainGroupPermissionCalculatorInterface::calculatePermissions public function Calculates the full group permissions for an account. 1
ChainGroupPermissionCalculatorInterface::getCalculators public function Gets all added calculators. 1
GroupPermissionCalculatorInterface::ANONYMOUS_CACHE_CONTEXTS constant The cache contexts that should always be present on anonymous permissions.
GroupPermissionCalculatorInterface::calculateAnonymousPermissions public function Calculates the anonymous group permissions. 2
GroupPermissionCalculatorInterface::calculateMemberPermissions public function Calculates the member group permissions for an account. 2
GroupPermissionCalculatorInterface::calculateOutsiderPermissions public function Calculates the outsider group permissions for an account. 2
GroupPermissionCalculatorInterface::MEMBER_CACHE_CONTEXTS constant The cache contexts that should always be present on member permissions. 1
GroupPermissionCalculatorInterface::OUTSIDER_CACHE_CONTEXTS constant The cache contexts that should always be present on outsider permissions. 1