function BasicExample::access

File

modules/action_example/src/Plugin/Action/BasicExample.php, line 62

Class

BasicExample
A basic example action that does nothing.

Namespace

Drupal\action_example\Plugin\Action

Code

public function access($object, ?AccountInterface $account = NULL, $return_as_object = FALSE) {
  $result = AccessResult::allowed();
  return $return_as_object ? $result : $result->isAllowed();
}