You are here

public function FullEntityPermissionProvider::getEntityViewUnpublishedPermission in Group 8

Gets the name of the view unpublished permission for the relation.

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.

Overrides GroupContentPermissionProvider::getEntityViewUnpublishedPermission

File

tests/modules/group_test_plugin/src/Plugin/GroupContentEnabler/FullEntityPermissionProvider.php, line 27

Class

FullEntityPermissionProvider
Provides all possible permissions.

Namespace

Drupal\group_test_plugin\Plugin\GroupContentEnabler

Code

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