function UnpublishByKeywordNode::access
Same name in other branches
- 9 core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php \Drupal\node\Plugin\Action\UnpublishByKeywordNode::access()
- 8.9.x core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php \Drupal\node\Plugin\Action\UnpublishByKeywordNode::access()
- 11.x core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php \Drupal\node\Plugin\Action\UnpublishByKeywordNode::access()
Overrides ActionInterface::access
File
-
core/
modules/ action/ src/ Plugin/ Action/ UnpublishByKeywordNode.php, line 73
Class
- UnpublishByKeywordNode
- Unpublishes a node containing certain keywords.
Namespace
Drupal\action\Plugin\ActionCode
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();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.