You are here

interface AccessManagerInterface in Administer Users by Role 8.3

Interface for access manager service.

Hierarchy

Expanded class hierarchy of AccessManagerInterface

All classes that implement AccessManagerInterface

2 files declare their use of AccessManagerInterface
AdministerusersbyrolePermissions.php in src/AdministerusersbyrolePermissions.php
SettingsForm.php in src/Form/SettingsForm.php

File

src/Services/AccessManagerInterface.php, line 10

Namespace

Drupal\administerusersbyrole\Services
View source
interface AccessManagerInterface {
  const SAFE = 'safe';
  const UNSAFE = 'unsafe';
  const PERM = 'perm';

  /**
   * Check access for the specified roles.
   *
   * @param array $roles
   *   Roles of the user object to check access for.
   *
   * @param string $operation
   *   The operation that is to be performed on the user.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The account trying to access the entity.
   *
   * @return \Drupal\Core\Access\AccessResultInterface
   *   The access result. hook_entity_access() has detailed documentation.
   */
  public function access(array $roles, $operation, AccountInterface $account);

  /**
   * List all accessible roles for the specified operation.
   *
   * @param string $operation
   *   The operation that is to be performed.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The account trying to access the entity.
   *
   * @return array of role IDs.
   */
  public function listRoles($operation, AccountInterface $account);

  /**
   * Acts on changes to configured roles.
   */
  public function rolesChanged();

  /**
   * Return permissions to add.
   *
   * @return array of permissions.
   */
  public function permissions();

  /**
   * Returns a list of all roles that are available to be managed by this module.
   *
   * @return \Drupal\user\RoleInterface[]
   *   An associative array with the role id as the key and the role object as
   *   value.
   */
  public function managedRoles();

}

Members

Namesort descending Modifiers Type Description Overrides
AccessManagerInterface::access public function Check access for the specified roles. 1
AccessManagerInterface::listRoles public function List all accessible roles for the specified operation. 1
AccessManagerInterface::managedRoles public function Returns a list of all roles that are available to be managed by this module. 1
AccessManagerInterface::PERM constant
AccessManagerInterface::permissions public function Return permissions to add. 1
AccessManagerInterface::rolesChanged public function Acts on changes to configured roles. 1
AccessManagerInterface::SAFE constant
AccessManagerInterface::UNSAFE constant