You are here

interface WorkbenchAccessManagerInterface in Workbench Access 8

Defines an interface handling Workbench Access configuration.

Hierarchy

Expanded class hierarchy of WorkbenchAccessManagerInterface

All classes that implement WorkbenchAccessManagerInterface

20 files declare their use of WorkbenchAccessManagerInterface
AccessCacheTest.php in tests/src/Functional/AccessCacheTest.php
AccessSchemeAddForm.php in src/Form/AccessSchemeAddForm.php
AssignUserForm.php in src/Form/AssignUserForm.php
EntityTestAccessTest.php in tests/src/Kernel/EntityTestAccessTest.php
FilterAccessTest.php in tests/src/Kernel/FilterAccessTest.php

... See full list

File

src/WorkbenchAccessManagerInterface.php, line 12

Namespace

Drupal\workbench_access
View source
interface WorkbenchAccessManagerInterface extends PluginManagerInterface {

  // @TODO: Remove.
  const FIELD_NAME = 'field_workbench_access';

  /**
   * Checks that an entity belongs to a user section or its children.
   *
   * @param \Drupal\workbench_access\Entity\AccessSchemeInterface $scheme
   *   Access scheme.
   * @param array $entity_sections
   *   The section assignments for the entity. An array of section ids.
   * @param array $user_sections
   *   The section assignments for the user. An array of section ids.
   *
   *   return boolean.
   */
  public static function checkTree(AccessSchemeInterface $scheme, array $entity_sections, array $user_sections);

  /**
   * Returns a flat array of all active section ids.
   *
   * Used to display assignments for admins.
   *
   * @param \Drupal\workbench_access\Entity\AccessSchemeInterface $scheme
   *   Access scheme.
   * @param bool $root_only
   *   If TRUE, only show the root-level assignments.
   *
   * @return array
   *   All sections for given scheme.
   */
  public static function getAllSections(AccessSchemeInterface $scheme, $root_only = FALSE);

  /**
   * Determines if a user is assigned to all sections.
   *
   * This method checks the permissions and assignments for a user. Someone set
   * as an admin or with access to the top-level sections is assumed to be able
   * to access all sections. We use this logic in query filtering.
   *
   * @param \Drupal\workbench_access\Entity\AccessSchemeInterface $scheme
   *   Access scheme.
   * @param \Drupal\Core\Session\AccountInterface $account
   *   Account being checked.
   *
   * @return bool
   *   TRUE if user is in all schemes.
   */
  public function userInAll(AccessSchemeInterface $scheme, AccountInterface $account = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
DiscoveryInterface::getDefinition public function Gets a specific plugin definition. 4
DiscoveryInterface::getDefinitions public function Gets the definition of all plugins for this type. 3
DiscoveryInterface::hasDefinition public function Indicates if a specific plugin definition exists. 2
FactoryInterface::createInstance public function Creates a pre-configured instance of a plugin. 7
MapperInterface::getInstance public function Gets a preconfigured instance of a plugin. 4
WorkbenchAccessManagerInterface::checkTree public static function Checks that an entity belongs to a user section or its children. 1
WorkbenchAccessManagerInterface::FIELD_NAME constant
WorkbenchAccessManagerInterface::getAllSections public static function Returns a flat array of all active section ids. 1
WorkbenchAccessManagerInterface::userInAll public function Determines if a user is assigned to all sections. 1