src/Application/Project/ContentBundle/Controller/ContentAdminController.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Application\Project\ContentBundle\Controller;
  3. use App\Application\Project\ContentBundle\Controller\Base\BaseAdminController;
  4. use Symfony\Component\HttpFoundation\JsonResponse;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  7. class ContentAdminController extends BaseAdminController
  8. {
  9.     /**
  10.      * @param AuthenticationUtils $authenticationUtils
  11.      * @return Response
  12.      */
  13.     public function loginAction(AuthenticationUtils $authenticationUtils): Response
  14.     {
  15.         $error $authenticationUtils->getLastAuthenticationError();
  16.         $lastUsername $authenticationUtils->getLastUsername();
  17.         return $this->render('@ApplicationProjectSecurityAdmin/auth/login.html.twig', [
  18.             'last_username' => $lastUsername,
  19.             'error' => $error
  20.         ]);
  21.     }
  22.     public function logoutAction(): void
  23.     {
  24.         throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
  25.     }
  26.     /** @return Response */
  27.     public function accessDeniedAction(): Response
  28.     {
  29.         return $this->render('@ApplicationProjectSecurityAdmin/error/error_403.html.twig');
  30.     }
  31.     public function listAllRolesAction(): JsonResponse
  32.     {
  33.         $rolesGroups = [
  34.             "adminRoles" => $this->adminACL->getAdminGroupRoles(),
  35.             "apiRoles" => $this->apiACL->getApiGroupRoles(),
  36.             "webRoles" => $this->webACL->getWebGroupRoles(),
  37.         ];
  38.         return $this->json($rolesGroups);
  39.     }
  40.     public function listAdminGroupRolesAction(): JsonResponse
  41.     {
  42.         return $this->json($this->adminACL->getAdminGroupRoles());
  43.     }
  44.     public function listAdminRolesAction(): JsonResponse
  45.     {
  46.         return $this->json($this->adminACL->getAdminRoles());
  47.     }
  48. }