From e27b15691af877e7001334c7e294fa3e916b539f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Tue, 6 Feb 2024 22:09:02 +0100 Subject: [PATCH] Fixed permission denied error, when trying to access the log details page of a LabelProfile --- src/Security/Voter/LabelProfileVoter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Security/Voter/LabelProfileVoter.php b/src/Security/Voter/LabelProfileVoter.php index 3d3f7f6f..acccd435 100644 --- a/src/Security/Voter/LabelProfileVoter.php +++ b/src/Security/Voter/LabelProfileVoter.php @@ -68,7 +68,7 @@ final class LabelProfileVoter extends Voter protected function supports($attribute, $subject): bool { - if ($subject instanceof LabelProfile) { + if (is_a($subject, LabelProfile::class, true)) { if (!isset(self::MAPPING[$attribute])) { return false; } @@ -86,6 +86,6 @@ final class LabelProfileVoter extends Voter public function supportsType(string $subjectType): bool { - return is_a($subjectType, LabelProfile::class, true); + return $subjectType === 'string' || is_a($subjectType, LabelProfile::class, true); } }