You are here

protected function RevisionOverviewController::hasRevertRevisionAccess in Entity API 8

Same name and namespace in other branches
  1. 8.0 src/Controller/RevisionOverviewController.php \Drupal\entity\Controller\RevisionOverviewController::hasRevertRevisionAccess()

Determines if the user has permission to revert revisions.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to check revert access for.

Return value

bool TRUE if the user has revert access.

Overrides RevisionControllerTrait::hasRevertRevisionAccess

File

src/Controller/RevisionOverviewController.php, line 154

Class

RevisionOverviewController
Provides a controller which shows the revision history.

Namespace

Drupal\entity\Controller

Code

protected function hasRevertRevisionAccess(EntityInterface $entity) {
  return AccessResult::allowedIfHasPermission($this
    ->currentUser(), "revert all {$entity->getEntityTypeId()} revisions")
    ->orIf(AccessResult::allowedIfHasPermission($this
    ->currentUser(), "revert {$entity->bundle()} {$entity->getEntityTypeId()} revisions"));
}