You are here

protected function PermissionProvider::getEntityViewPermission in Group 2.0.x

Gets the name of the view permission for the entity.

Parameters

string $scope: (optional) Whether the 'any' or 'own' permission name should be returned. Defaults to 'any'.

Return value

string|false The permission name or FALSE if it does not apply.

1 call to PermissionProvider::getEntityViewPermission()
PermissionProvider::getPermission in src/Plugin/Group/RelationHandlerDefault/PermissionProvider.php
Gets the name of the permission for the given operation, target and scope.

File

src/Plugin/Group/RelationHandlerDefault/PermissionProvider.php, line 213

Class

PermissionProvider
Provides group permissions for group relation plugins.

Namespace

Drupal\group\Plugin\Group\RelationHandlerDefault

Code

protected function getEntityViewPermission($scope = 'any') {
  if ($this->definesEntityPermissions) {

    // @todo Implement view own permission.
    if ($scope === 'any') {

      // Backwards compatible permission name for 'any' scope.
      return "view {$this->pluginId} entity";
    }
  }
  return FALSE;
}