You are here

function tmgmt_local_view_access in Translation Management Tool 8

Implements hook_view_access().

File

translators/tmgmt_local/tmgmt_local.module, line 266
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();
}