function tmgmt_local_view_access

Implements hook_view_access().

File

translators/tmgmt_local/tmgmt_local.module, line 267
Main module file for the local translation module.

Code

function tmgmt_local_view_access(\Drupal\Core\Entity\EntityInterface $entity, $operation, \Drupal\Core\Session\AccountInterface $account) {
  if ($entity
    ->id() == 'tmgmt_local_task_overview') {
    switch ($operation) {
      case 'delete':
        return AccessResult::forbidden();
    }
  }
  return AccessResult::neutral();
}