function AssignOwnerNode::access
Same name in other branches
- 9 core/modules/node/src/Plugin/Action/AssignOwnerNode.php \Drupal\node\Plugin\Action\AssignOwnerNode::access()
- 8.9.x core/modules/node/src/Plugin/Action/AssignOwnerNode.php \Drupal\node\Plugin\Action\AssignOwnerNode::access()
- 10 core/modules/action/src/Plugin/Action/AssignOwnerNode.php \Drupal\action\Plugin\Action\AssignOwnerNode::access()
Overrides ActionInterface::access
File
-
core/
modules/ node/ src/ Plugin/ Action/ AssignOwnerNode.php, line 137
Class
- AssignOwnerNode
- Assigns ownership of a node to a user.
Namespace
Drupal\node\Plugin\ActionCode
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
/** @var \Drupal\node\NodeInterface $object */
$result = $object->access('update', $account, TRUE)
->andIf($object->getOwner()
->access('edit', $account, TRUE));
return $return_as_object ? $result : $result->isAllowed();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.