You are here

protected function FullEntityPermissionProvider::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 FullEntityPermissionProvider::getEntityViewPermission()
FullEntityPermissionProvider::getPermission in tests/modules/group_test_plugin/src/Plugin/Group/RelationHandler/FullEntityPermissionProvider.php
Gets the name of the permission for the given operation, target and scope.

File

tests/modules/group_test_plugin/src/Plugin/Group/RelationHandler/FullEntityPermissionProvider.php, line 84

Class

FullEntityPermissionProvider
Provides all possible permissions.

Namespace

Drupal\group_test_plugin\Plugin\Group\RelationHandler

Code

protected function getEntityViewPermission($scope = 'any') {
  if ($this->definesEntityPermissions) {
    if ($this->implementsOwnerInterface || $scope === 'any') {
      return "view {$scope} {$this->pluginId} entity";
    }
  }
  return FALSE;
}