You are here

public function VBExportAction::access in Content Export YAML 8

File

modules/vbo_content_export_yaml/src/Plugin/Action/VBExportAction.php, line 120

Class

VBExportAction
An example action covering most of the possible options.

Namespace

Drupal\vbo_content_export_yaml\Plugin\Action

Code

public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
  if ($object
    ->getEntityType() === 'node') {
    $access = $object
      ->access('update', $account, TRUE)
      ->andIf($object->status
      ->access('edit', $account, TRUE));
    return $return_as_object ? $access : $access
      ->isAllowed();
  }

  // kint($object->getEntityType());die();
  // Other entity types may have different
  // access methods and properties.
  return TRUE;
}