From 6ac6325024a2e7bcf996115db4f8a16474c55c36 Mon Sep 17 00:00:00 2001
From: Nathaniel Catchpole <catch@35733.no-reply.drupal.org>
Date: Thu, 21 Dec 2017 10:55:00 +0000
Subject: [PATCH] Issue #2931339 by manuel.adan: Unused variable
 $admin_permission in EntityAccessControlHandler::checkAccess

---
 core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php b/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php
index ac364115ebd6..c67c2ed3c30f 100644
--- a/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php
+++ b/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php
@@ -158,7 +158,7 @@ protected function checkAccess(EntityInterface $entity, $operation, AccountInter
       return AccessResult::forbidden()->addCacheableDependency($entity);
     }
     if ($admin_permission = $this->entityType->getAdminPermission()) {
-      return AccessResult::allowedIfHasPermission($account, $this->entityType->getAdminPermission());
+      return AccessResult::allowedIfHasPermission($account, $admin_permission);
     }
     else {
       // No opinion.
-- 
GitLab