You are here

protected function SignupAccessControlHandler::checkAccess in SendinBlue 8

Same name and namespace in other branches
  1. 8.2 src/Access/SignupAccessControlHandler.php \Drupal\sendinblue\Access\SignupAccessControlHandler::checkAccess()

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

Overrides EntityAccessControlHandler::checkAccess

File

src/Access/SignupAccessControlHandler.php, line 23

Class

SignupAccessControlHandler
Access controller for the comment entity.

Namespace

Drupal\sendinblue\Access

Code

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