From d8d52f4a6afdf54599014798e7a066aa0a9b792f Mon Sep 17 00:00:00 2001 From: TolstoyDotCom Date: Tue, 28 Apr 2026 19:46:59 -0700 Subject: [PATCH] Fix an issue only evident when using PHPStan at level 8. --- .../_content-entity/src/ExampleAccessControlHandler.php.twig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/Entity/_content-entity/src/ExampleAccessControlHandler.php.twig b/templates/Entity/_content-entity/src/ExampleAccessControlHandler.php.twig index 691ece9d..a21f159a 100644 --- a/templates/Entity/_content-entity/src/ExampleAccessControlHandler.php.twig +++ b/templates/Entity/_content-entity/src/ExampleAccessControlHandler.php.twig @@ -22,7 +22,8 @@ final class {{ class }}AccessControlHandler extends EntityAccessControlHandler { * {@inheritdoc} */ protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account): AccessResult { - if ($account->hasPermission($this->entityType->getAdminPermission())) { + $permission = $this->entityType->getAdminPermission(); + if (is_string($permission) && $account->hasPermission($permission)) { return AccessResult::allowed()->cachePerPermissions(); }