Skip to content
Snippets Groups Projects
Commit 6558a769 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2129809 by damiankloip: Remove usage of user_access() in NodeRevisionAccessCheck.

parent b5581dcf
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -135,7 +135,7 @@ public function checkAccess(NodeInterface $node, AccountInterface $account, $op
if (!isset($this->access[$cid])) {
// Perform basic permission checks first.
if (!user_access($map[$op], $account) && !user_access($type_map[$op], $account) && !user_access('administer nodes', $account)) {
if (!$account->hasPermission($map[$op]) && !$account->hasPermission($type_map[$op]) && !$account->hasPermission('administer nodes')) {
return $this->access[$cid] = FALSE;
}
......@@ -147,7 +147,7 @@ public function checkAccess(NodeInterface $node, AccountInterface $account, $op
if ($node->isDefaultRevision() && ($this->connection->query('SELECT COUNT(*) FROM {node_field_revision} WHERE nid = :nid AND default_langcode = 1', array(':nid' => $node->id()))->fetchField() == 1 || $op == 'update' || $op == 'delete')) {
$this->access[$cid] = FALSE;
}
elseif (user_access('administer nodes', $account)) {
elseif ($account->hasPermission('administer nodes')) {
$this->access[$cid] = TRUE;
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment