You are here

public function UnpublishByKeywordNode::access in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php \Drupal\node\Plugin\Action\UnpublishByKeywordNode::access()
  2. 9 core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php \Drupal\node\Plugin\Action\UnpublishByKeywordNode::access()

File

core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php, line 70

Class

UnpublishByKeywordNode
Unpublishes a node containing certain keywords.

Namespace

Drupal\node\Plugin\Action

Code

public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {

  /** @var \Drupal\node\NodeInterface $object */
  $access = $object
    ->access('update', $account, TRUE)
    ->andIf($object->status
    ->access('edit', $account, TRUE));
  return $return_as_object ? $access : $access
    ->isAllowed();
}