diff --git a/core/modules/action/src/Plugin/Action/GotoAction.php b/core/modules/action/src/Plugin/Action/GotoAction.php index c925c5c..4ab688e 100644 --- a/core/modules/action/src/Plugin/Action/GotoAction.php +++ b/core/modules/action/src/Plugin/Action/GotoAction.php @@ -119,8 +119,8 @@ public function submitConfigurationForm(array &$form, FormStateInterface $form_s * {@inheritdoc} */ public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { - $result = AccessResult::allowed(); - return $return_as_object ? $result : $result->isAllowed(); + $access = AccessResult::allowed(); + return $return_as_object ? $access : $access->isAllowed(); } } diff --git a/core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php b/core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php index 7684af6..f0d8b13 100644 --- a/core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php +++ b/core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php @@ -71,10 +71,10 @@ public function submitConfigurationForm(array &$form, FormStateInterface $form_s */ public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { /** @var \Drupal\node\NodeInterface $object */ - $result = $object->access('update', $account, TRUE) + $access = $object->access('update', $account, TRUE) ->andIf($object->status->access('edit', $account, TRUE)); - return $return_as_object ? $result : $result->isAllowed(); + return $return_as_object ? $access : $access->isAllowed(); } } diff --git a/core/modules/node/src/Plugin/Action/UnpublishNode.php b/core/modules/node/src/Plugin/Action/UnpublishNode.php index 3672607..deea6a1 100644 --- a/core/modules/node/src/Plugin/Action/UnpublishNode.php +++ b/core/modules/node/src/Plugin/Action/UnpublishNode.php @@ -34,10 +34,10 @@ public function execute($entity = NULL) { */ public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { /** @var \Drupal\node\NodeInterface $object */ - $result = $object->access('update', $account, TRUE) + $access = $object->access('update', $account, TRUE) ->andIf($object->status->access('edit', $account, TRUE)); - return $return_as_object ? $result : $result->isAllowed(); + return $return_as_object ? $access : $access->isAllowed(); } } diff --git a/core/modules/node/src/Plugin/Action/UnstickyNode.php b/core/modules/node/src/Plugin/Action/UnstickyNode.php index 1b8cd0b..e49e076 100644 --- a/core/modules/node/src/Plugin/Action/UnstickyNode.php +++ b/core/modules/node/src/Plugin/Action/UnstickyNode.php @@ -34,10 +34,10 @@ public function execute($entity = NULL) { */ public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { /** @var \Drupal\node\NodeInterface $object */ - $result = $object->access('update', $account, TRUE) + $access = $object->access('update', $account, TRUE) ->andIf($object->sticky->access('edit', $account, TRUE)); - return $return_as_object ? $result : $result->isAllowed(); + return $return_as_object ? $access : $access->isAllowed(); } } diff --git a/core/modules/node/src/Tests/Views/BulkFormAccessTest.php b/core/modules/node/src/Tests/Views/BulkFormAccessTest.php index d0cf35c..e79cfa0 100644 --- a/core/modules/node/src/Tests/Views/BulkFormAccessTest.php +++ b/core/modules/node/src/Tests/Views/BulkFormAccessTest.php @@ -111,7 +111,7 @@ public function testNodeEditAccess() { // Ensure that the private node can not be edited. $this->assertEqual(FALSE, $node->access('update', $account), 'The node may not be edited.'); - $this->assertEqual(TRUE, $node->status->access('edit', $account), 'The node can be edited.'); + $this->assertEqual(TRUE, $node->status->access('edit', $account), 'The node status can be edited.'); // Test editing the node using the bulk form. $edit = array( diff --git a/core/modules/user/src/Plugin/Action/BlockUser.php b/core/modules/user/src/Plugin/Action/BlockUser.php index a8d51dd..6c897af 100644 --- a/core/modules/user/src/Plugin/Action/BlockUser.php +++ b/core/modules/user/src/Plugin/Action/BlockUser.php @@ -40,10 +40,10 @@ public function execute($account = NULL) { */ public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { /** @var \Drupal\user\UserInterface $object */ - $result = $object->status->access('edit', $account, TRUE) + $access = $object->status->access('edit', $account, TRUE) ->andIf($object->access('update', $account, TRUE)); - return $return_as_object ? $result : $result->isAllowed(); + return $return_as_object ? $access : $access->isAllowed(); } } diff --git a/core/modules/user/src/Plugin/Action/ChangeUserRoleBase.php b/core/modules/user/src/Plugin/Action/ChangeUserRoleBase.php index 8981c23..506bb0e 100644 --- a/core/modules/user/src/Plugin/Action/ChangeUserRoleBase.php +++ b/core/modules/user/src/Plugin/Action/ChangeUserRoleBase.php @@ -97,10 +97,10 @@ public function calculateDependencies() { */ public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { /** @var \Drupal\user\UserInterface $object */ - $result = $object->access('update', $account, TRUE) + $access = $object->access('update', $account, TRUE) ->andIf($object->roles->access('edit', $account, TRUE)); - return $return_as_object ? $result : $result->isAllowed(); + return $return_as_object ? $access : $access->isAllowed(); } } diff --git a/core/modules/user/src/Plugin/Action/UnblockUser.php b/core/modules/user/src/Plugin/Action/UnblockUser.php index f9ca68a..09ca3d2 100644 --- a/core/modules/user/src/Plugin/Action/UnblockUser.php +++ b/core/modules/user/src/Plugin/Action/UnblockUser.php @@ -37,10 +37,10 @@ public function execute($account = NULL) { */ public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) { /** @var \Drupal\user\UserInterface $object */ - $result = $object->status->access('edit', $account, TRUE) + $access = $object->status->access('edit', $account, TRUE) ->andIf($object->access('update', $account, TRUE)); - return $return_as_object ? $result : $result->isAllowed(); + return $return_as_object ? $access : $access->isAllowed(); } } diff --git a/core/modules/user/src/Tests/Views/BulkFormAccessTest.php b/core/modules/user/src/Tests/Views/BulkFormAccessTest.php index 5044098..8ffcc92 100644 --- a/core/modules/user/src/Tests/Views/BulkFormAccessTest.php +++ b/core/modules/user/src/Tests/Views/BulkFormAccessTest.php @@ -63,11 +63,6 @@ public function testUserEditAccess() { '@entity_type_label' => 'User', '%entity_label' => $no_edit_user->label(), ])); - debug(String::format('No access to execute %action on the @entity_type_label %entity_label.', [ - '%action' => 'Block the selected user(s)', - '@entity_type_label' => 'User', - '%entity_label' => $no_edit_user->label(), - ])); // Re-load the account "no_edit" and ensure it is not blocked. $no_edit_user = User::load($no_edit_user->id());