Skip to content

Commit e35e12c

Browse files
committed
fix(security): setting object to OBJECT_TO_POPULATE for security expression
1 parent e2e59b0 commit e35e12c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Serializer/AbstractItemNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ protected function canAccessAttribute(?object $object, string $attribute, array
441441
$security = $propertyMetadata->getSecurity();
442442
if (null !== $this->resourceAccessChecker && $security) {
443443
return $this->resourceAccessChecker->isGranted($context['resource_class'], $security, [
444-
'object' => $object,
444+
'object' => $object ?? $context[self::OBJECT_TO_POPULATE] ?? null,
445445
]);
446446
}
447447

0 commit comments

Comments
 (0)