Skip to content

Commit 72e601c

Browse files
authored
IBX-10170: Refactored access check to use new contract interface (#1603)
* IBX-10170: Refactored access check to use new contract interface * Dropped service definition * renamed to RestrictedControllerInterface
1 parent 94b0b3a commit 72e601c

File tree

3 files changed

+4
-43
lines changed

3 files changed

+4
-43
lines changed

src/bundle/EventSubscriber/PerformAccessCheckSubscriber.php

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/bundle/Resources/config/services/events.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ services:
1010
tags:
1111
- { name: kernel.event_subscriber }
1212

13-
Ibexa\Bundle\AdminUi\EventSubscriber\PerformAccessCheckSubscriber:
14-
tags:
15-
- { name: kernel.event_subscriber }
16-
1713
Ibexa\AdminUi\EventListener\RequestListener:
1814
arguments:
1915
- '%ibexa.site_access.groups_by_site_access%'

src/contracts/Controller/Controller.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99
namespace Ibexa\Contracts\AdminUi\Controller;
1010

1111
use Ibexa\Contracts\Core\Repository\Values\Content\Location;
12+
use Ibexa\Contracts\User\Controller\AuthenticatedRememberedCheckTrait;
13+
use Ibexa\Contracts\User\Controller\RestrictedControllerInterface;
1214
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
1315
use Symfony\Component\HttpFoundation\RedirectResponse;
1416

15-
abstract class Controller extends AbstractController
17+
abstract class Controller extends AbstractController implements RestrictedControllerInterface
1618
{
17-
public function performAccessCheck(): void
18-
{
19-
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
20-
}
19+
use AuthenticatedRememberedCheckTrait;
2120

2221
public function redirectToLocation(Location $location, string $uriFragment = ''): RedirectResponse
2322
{

0 commit comments

Comments
 (0)