Skip to content

Commit 710c670

Browse files
committed
Added AuthenticatedRememberedCheckTrait
1 parent c2ac2fa commit 710c670

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

code_samples/back_office/limitation/src/Controller/CustomController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@
66
use Ibexa\Contracts\AdminUi\Controller\Controller;
77
use Ibexa\Contracts\AdminUi\Permission\PermissionCheckerInterface;
88
use Ibexa\Contracts\Core\Repository\PermissionResolver;
9+
use Ibexa\Contracts\User\Controller\AuthenticatedRememberedCheckTrait;
910
use Ibexa\Contracts\User\Controller\RestrictedControllerInterface;
1011
use Ibexa\Core\MVC\Symfony\Security\Authorization\Attribute;
1112
use Symfony\Component\HttpFoundation\Request;
1213
use Symfony\Component\HttpFoundation\Response;
1314

1415
class CustomController extends Controller implements RestrictedControllerInterface
1516
{
17+
use AuthenticatedRememberedCheckTrait {
18+
AuthenticatedRememberedCheckTrait::performAccessCheck as public traitPerformAccessCheck;
19+
}
20+
1621
public function __construct(
1722
// ...,
1823
private readonly PermissionResolver $permissionResolver,
@@ -40,6 +45,7 @@ private function getCustomLimitationValue(): bool
4045

4146
public function performAccessCheck(): void
4247
{
48+
$this->traitPerformAccessCheck();
4349
$this->denyAccessUnlessGranted(new Attribute('custom_module', 'custom_function_2'));
4450
}
4551
}

0 commit comments

Comments
 (0)