You are here

interface PermissionProviderInterface in Group 2.0.x

Provides a common interface for group relation permission providers.

Hierarchy

Expanded class hierarchy of PermissionProviderInterface

All classes that implement PermissionProviderInterface

7 files declare their use of PermissionProviderInterface
AccessControlTest.php in tests/src/Unit/AccessControlTest.php
BarAdminPermissionProvider.php in tests/modules/group_test_plugin_alter/src/Plugin/Group/RelationHandler/BarAdminPermissionProvider.php
BazAdminPermissionProvider.php in tests/modules/group_test_plugin_alter/src/Plugin/Group/RelationHandler/BazAdminPermissionProvider.php
FooAdminPermissionProvider.php in tests/modules/group_test_plugin_alter/src/Plugin/Group/RelationHandler/FooAdminPermissionProvider.php
FullEntityPermissionProvider.php in tests/modules/group_test_plugin/src/Plugin/Group/RelationHandler/FullEntityPermissionProvider.php

... See full list

File

src/Plugin/Group/RelationHandler/PermissionProviderInterface.php, line 8

Namespace

Drupal\group\Plugin\Group\RelationHandler
View source
interface PermissionProviderInterface extends RelationHandlerInterface {

  /**
   * Gets the name of the admin permission.
   *
   * @return string|false
   *   The admin permission name or FALSE if none was set.
   */
  public function getAdminPermission();

  /**
   * Gets the name of the permission for the given operation, target and scope.
   *
   * @param string $operation
   *   The permission operation. Usually "create", "view", "update" or "delete".
   * @param string $target
   *   The target of the operation. Can be 'relation' or 'entity'.
   * @param string $scope
   *   (optional) Whether the 'any' or 'own' permission name should be returned.
   *   Defaults to 'any'.
   *
   * @return string|false
   *   The permission name or FALSE if it does not apply.
   */
  public function getPermission($operation, $target, $scope = 'any');

  /**
   * Provides a list of group permissions the plugin exposes.
   *
   * If you have some group permissions that would only make sense when your
   * plugin is installed, you may define those here. They will not be shown on
   * the permission configuration form unless the plugin is installed.
   *
   * @return array
   *   An array of group permissions, see GroupPermissionHandlerInterface for
   *   the structure of a group permission.
   *
   * @see GroupPermissionHandlerInterface::getPermissions()
   */
  public function buildPermissions();

}

Members

Namesort descending Modifiers Type Description Overrides
PermissionProviderInterface::buildPermissions public function Provides a list of group permissions the plugin exposes.
PermissionProviderInterface::getAdminPermission public function Gets the name of the admin permission.
PermissionProviderInterface::getPermission public function Gets the name of the permission for the given operation, target and scope.
RelationHandlerInterface::init public function Initializes the handler.