From 4ce632119fbe2b354c9f956f2fdb30647ef041d9 Mon Sep 17 00:00:00 2001 From: James Wragg <5068769+jerotire@users.noreply.github.com> Date: Tue, 12 Nov 2024 09:17:32 +0000 Subject: [PATCH] fix: only op-tc are affected by the submit app/var block op-adm check (#447) * fix: only op-tc are affected by the submit app/var block op-adm check * chore: cleanup imports --- .../Controller/Lva/AbstractUndertakingsController.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/selfserve/module/Olcs/src/Controller/Lva/AbstractUndertakingsController.php b/app/selfserve/module/Olcs/src/Controller/Lva/AbstractUndertakingsController.php index b4586afaf5..50ea72f138 100644 --- a/app/selfserve/module/Olcs/src/Controller/Lva/AbstractUndertakingsController.php +++ b/app/selfserve/module/Olcs/src/Controller/Lva/AbstractUndertakingsController.php @@ -15,7 +15,6 @@ use Dvsa\Olcs\Transfer\Command\GovUkAccount\GetGovUkAccountRedirect; use Dvsa\Olcs\Transfer\Query\FeatureToggle\IsEnabled as IsEnabledQry; use Dvsa\Olcs\Transfer\Query\User\OperatorAdminForOrganisationHasLoggedIn; -use Dvsa\Olcs\Transfer\Query\User\UserListSelfserve; use Dvsa\Olcs\Transfer\Util\Annotation\AnnotationBuilder; use Dvsa\Olcs\Utils\Translation\NiTextTranslation; use Exception; @@ -348,12 +347,9 @@ private function operatorAdminForOrganisationHasLoggedIn($organisationId): bool */ protected function checkIfOperatorAdminHasLoggedIn($organisationId, $form = null): bool { - /** - * @todo we need this check to always return true for now - * @see https://dvsa.atlassian.net/browse/VOL-5886 - * @see https://dvsa.atlassian.net/browse/VOL-5885 - */ - return true; + if (!$this->authService->isGranted(RefData::ROLE_OPERATOR_TC)) { + return true; + } $operatorAdminHasLoggedIn = $this->operatorAdminForOrganisationHasLoggedIn($organisationId);