You are here

interface CalculatedGroupPermissionsItemInterface in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Access/CalculatedGroupPermissionsItemInterface.php \Drupal\group\Access\CalculatedGroupPermissionsItemInterface

Defines the calculated group permissions item interface.

Hierarchy

Expanded class hierarchy of CalculatedGroupPermissionsItemInterface

All classes that implement CalculatedGroupPermissionsItemInterface

8 files declare their use of CalculatedGroupPermissionsItemInterface
CalculatedGroupPermissionsItemTest.php in tests/src/Unit/CalculatedGroupPermissionsItemTest.php
CalculatedGroupPermissionsTest.php in tests/src/Unit/CalculatedGroupPermissionsTest.php
EntityQueryAlter.php in src/QueryAccess/EntityQueryAlter.php
GroupContentQueryAccessHandler.php in src/Entity/Access/GroupContentQueryAccessHandler.php
GroupPermissionCheckerTest.php in tests/src/Unit/GroupPermissionCheckerTest.php

... See full list

File

src/Access/CalculatedGroupPermissionsItemInterface.php, line 8

Namespace

Drupal\group\Access
View source
interface CalculatedGroupPermissionsItemInterface {

  /**
   * The scope for group based permissions (e.g.: memberships).
   */
  const SCOPE_GROUP = 'group';

  /**
   * The scope for group type based permissions (e.g.: anonymous or outsider).
   */
  const SCOPE_GROUP_TYPE = 'group_type';

  /**
   * Returns the scope of the calculated permissions item.
   *
   * @return string
   *   The scope name.
   */
  public function getScope();

  /**
   * Returns the identifier within the scope.
   *
   * @return string|int
   *   The identifier.
   */
  public function getIdentifier();

  /**
   * Returns the permissions for the calculated permissions item.
   *
   * @return string[]
   *   The permission names.
   */
  public function getPermissions();

  /**
   * Returns whether this item grants admin privileges in its scope.
   *
   * @return bool
   *   Whether this item grants admin privileges.
   */
  public function isAdmin();

  /**
   * Returns whether this item has a given permission.
   *
   * This should take ::isAdmin() into account.
   *
   * @param string $permission
   *   The permission name.
   *
   * @return bool
   *   Whether this item has the permission.
   */
  public function hasPermission($permission);

}

Members

Namesort descending Modifiers Type Description Overrides
CalculatedGroupPermissionsItemInterface::getIdentifier public function Returns the identifier within the scope. 1
CalculatedGroupPermissionsItemInterface::getPermissions public function Returns the permissions for the calculated permissions item. 1
CalculatedGroupPermissionsItemInterface::getScope public function Returns the scope of the calculated permissions item. 1
CalculatedGroupPermissionsItemInterface::hasPermission public function Returns whether this item has a given permission. 1
CalculatedGroupPermissionsItemInterface::isAdmin public function Returns whether this item grants admin privileges in its scope. 1
CalculatedGroupPermissionsItemInterface::SCOPE_GROUP constant The scope for group based permissions (e.g.: memberships).
CalculatedGroupPermissionsItemInterface::SCOPE_GROUP_TYPE constant The scope for group type based permissions (e.g.: anonymous or outsider).