You are here

protected function FlipbookAccessControlHandler::checkAccess in 3D Flipbook 8

Link the activities to the permissions. checkAccess is called with the $operation as defined in the routing.yml file.

Overrides EntityAccessControlHandler::checkAccess

File

src/FlipbookAccessControlHandler.php, line 23

Class

FlipbookAccessControlHandler
Access controller for the comment entity.

Namespace

Drupal\flipbook

Code

protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
  switch ($operation) {
    case 'view':
      return AccessResult::allowedIfHasPermission($account, 'view flipbook entity');
    case 'edit':
      return AccessResult::allowedIfHasPermission($account, 'edit flipbook entity');
    case 'delete':
      return AccessResult::allowedIfHasPermission($account, 'delete flipbook entity');
  }
  return AccessResult::allowed();
}