Skip to content

Commit

Permalink
Merge c112064 into b6e3237
Browse files Browse the repository at this point in the history
  • Loading branch information
wachterjohannes committed Oct 12, 2021
2 parents b6e3237 + c112064 commit 551aaee
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Content/Infrastructure/Sulu/Preview/ContentObjectProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,26 @@ class ContentObjectProvider implements PreviewObjectProviderInterface
*/
private $contentRichEntityClass;

/**
* @var string|null
*/
private $securityContext;

/**
* @param class-string<ContentRichEntityInterface> $contentRichEntityClass
*/
public function __construct(
EntityManagerInterface $entityManager,
ContentResolverInterface $contentResolver,
ContentDataMapperInterface $contentDataMapper,
string $contentRichEntityClass
string $contentRichEntityClass,
?string $securityContext = null
) {
$this->entityManager = $entityManager;
$this->contentResolver = $contentResolver;
$this->contentDataMapper = $contentDataMapper;
$this->contentRichEntityClass = $contentRichEntityClass;
$this->securityContext = $securityContext;
}

/**
Expand Down Expand Up @@ -158,6 +165,11 @@ public function deserialize($serializedObject, $objectClass)
return $this->getObject($id, $locale);
}

public function getSecurityContext($id, $locale): ?string
{
return $this->securityContext;
}

protected function resolveContent(ContentRichEntityInterface $contentRichEntity, string $locale): ?DimensionContentInterface
{
try {
Expand Down

0 comments on commit 551aaee

Please sign in to comment.