Skip to content

Commit

Permalink
Resolved coding standard issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
BHenkemans committed Aug 2, 2024
1 parent 0349202 commit 49e55c2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions module/Decision/src/Controller/DecisionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ public function searchAction(): ViewModel
public function authorizationsAction(): Response|ViewModel
{
if (!$this->aclService->isAllowed('create', 'authorization')) {
$this->flashMessenger()->addErrorMessage($this->translator->translate('You are not allowed to authorize someone'));
$this->flashMessenger()->addErrorMessage($this->translator
->translate('You are not allowed to authorize someone'));

// Also throw, in case the flashMessenger is not present on this page.
throw new NotAllowedException(
$this->translator->translate('You are not allowed to authorize someone'),
Expand All @@ -187,7 +189,9 @@ public function authorizationsAction(): Response|ViewModel

if ($form->isValid()) {
if (null !== ($authorization = $this->decisionService->createAuthorization($form->getData()))) {
$this->flashMessenger()->addSuccessMessage($this->translator->translate('Authorization Successful'));
$this->flashMessenger()->addSuccessMessage($this->translator
->translate('Authorization Successful'));

return $this->redirect()->toRoute('decision/authorizations');
}
}
Expand All @@ -209,7 +213,9 @@ public function authorizationsAction(): Response|ViewModel
public function revokeAuthorizationAction(): Response|ViewModel
{
if (!$this->aclService->isAllowed('revoke', 'authorization')) {
$this->flashMessenger()->addErrorMessage($this->translator->translate('You are not allowed to revoke authorizations.'));
$this->flashMessenger()->addErrorMessage($this->translator
->translate('You are not allowed to revoke authorizations.'));

// Also throw, in case the flashMessenger is not present on this page.
throw new NotAllowedException(
$this->translator->translate('You are not allowed to revoke authorizations.'),
Expand All @@ -226,7 +232,8 @@ public function revokeAuthorizationAction(): Response|ViewModel

if ($form->isValid()) {
$this->decisionService->revokeAuthorization($authorization);
$this->flashMessenger()->addSuccessMessage($this->translator->translate('Revocation Successful'));
$this->flashMessenger()->addSuccessMessage($this->translator
->translate('Revocation Successful'));
}
}
}
Expand Down

0 comments on commit 49e55c2

Please sign in to comment.