diff --git a/core/modules/node/src/Plugin/Action/PromoteNode.php b/core/modules/node/src/Plugin/Action/PromoteNode.php index a7ca2d2..c0bdc02 100644 --- a/core/modules/node/src/Plugin/Action/PromoteNode.php +++ b/core/modules/node/src/Plugin/Action/PromoteNode.php @@ -35,10 +35,8 @@ public function execute($entity = NULL) { */ public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { /** @var \Drupal\node\NodeInterface $object */ - $status_access = $object->status->access('edit', $account, TRUE); - $promoted_access = $object->promote->access('edit', $account, TRUE); - $update_access = $object->access('update', $account, TRUE); - $access = $status_access->andIf($promoted_access)->andIf($update_access); + $access = $object->access('update', $account, TRUE) + ->andif($object->promote->access('edit', $account, TRUE)); return $return_as_object ? $access : $access->isAllowed(); } diff --git a/core/modules/node/src/Plugin/Action/StickyNode.php b/core/modules/node/src/Plugin/Action/StickyNode.php index 021161a..0aecc92 100644 --- a/core/modules/node/src/Plugin/Action/StickyNode.php +++ b/core/modules/node/src/Plugin/Action/StickyNode.php @@ -35,10 +35,8 @@ public function execute($entity = NULL) { */ public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { /** @var \Drupal\node\NodeInterface $object */ - $status_access = $object->status->access('edit', $account, TRUE); - $sticky_access = $object->sticky->access('edit', $account, TRUE); - $update_access = $object->access('update', $account, TRUE); - $access = $status_access->andIf($sticky_access)->andIf($update_access); + $access = $object->access('update', $account, TRUE) + ->andif($object->sticky->access('edit', $account, TRUE)); return $return_as_object ? $access : $access->isAllowed(); }