Skip to content

Commit

Permalink
Allow fe_group modification when indexing restricted subpage
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Schilter committed Feb 27, 2024
1 parent 46ced72 commit aef7dcd
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Classes/EventListener/PageIndexer/FrontendGroupsModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,19 @@ class FrontendGroupsModifier
public function __invoke(ModifyResolvedFrontendGroupsEvent $event): void
{
$pageIndexerRequest = $event->getRequest()->getAttribute('solr.pageIndexingInstructions');
if (!$pageIndexerRequest instanceof PageIndexerRequest
|| (
(int)$pageIndexerRequest->getParameter('userGroup') === 0
&& (
(int)$pageIndexerRequest->getParameter('pageUserGroup') !== -2
&&
(int)$pageIndexerRequest->getParameter('pageUserGroup') < 1
)
if (!$pageIndexerRequest instanceof PageIndexerRequest) {
return;
}

$groups = $this->resolveFrontendUserGroups($pageIndexerRequest);

if ((int)$pageIndexerRequest->getParameter('userGroup') === 0
&& (
(int)$pageIndexerRequest->getParameter('pageUserGroup') !== -2
&&
(int)$pageIndexerRequest->getParameter('pageUserGroup') < 1
)
&& count($groups) === 0
) {
return;
}
Expand Down Expand Up @@ -76,7 +80,6 @@ public function __invoke(ModifyResolvedFrontendGroupsEvent $event): void
);
}

$groups = $this->resolveFrontendUserGroups($pageIndexerRequest);
if ((int)$pageIndexerRequest->getParameter('pageUserGroup') > 0) {
$groups[] = (int)$pageIndexerRequest->getParameter('pageUserGroup');
}
Expand Down

0 comments on commit aef7dcd

Please sign in to comment.