diff --git a/config/packages/security.yaml b/config/packages/security.yaml index ab531b70d83163ee4e35fbf3b49221c4c77712b1..730a51d59c5f378a09e2851542bc18acce65cccc 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -26,7 +26,7 @@ security: access_control: - { path: ^/admin, allow_if: "user and user.isAdmin == true" } - - { path: ^/locked, allow_if: "user and user.isLocked == true" } + - { path: ^/*, allow_if: "user and user.isLocked != true" } when@test: security: diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 0e63ddeecd626fd30e476e754ff43f0f5f3fd263..fef96537d168fa9c22c83f939f7e22f3df50e227 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -10,7 +10,6 @@ services: ports: - 3306:3306 environment: - MYSQL_ROOT_USER: 'root' MYSQL_ROOT_PASSWORD: 'root' networks: - dev diff --git a/src/Controller/WishlistController.php b/src/Controller/WishlistController.php index 1a39ebad3397e67b8f4a4f0fe0f45fa8d708130a..24a225ff6509c799ca1bd7a442bafd9c99337dde 100644 --- a/src/Controller/WishlistController.php +++ b/src/Controller/WishlistController.php @@ -15,7 +15,7 @@ use Symfony\Component\Routing\Attribute\Route; final class WishlistController extends AbstractController { #[Route(name: 'app_wishlist_index', methods: ['GET'])] - public function index(WishlistRepository $wishlistRepository): Response + public function getWishLists(WishlistRepository $wishlistRepository): Response { return $this->render('wishlist/index.html.twig', [ 'wishlists' => $wishlistRepository->findAll(), @@ -23,11 +23,11 @@ final class WishlistController extends AbstractController } #[Route('/new', name: 'app_wishlist_new', methods: ['GET', 'POST'])] - public function new(Request $request, EntityManagerInterface $entityManager): Response + public function createWishlist(Request $request, EntityManagerInterface $entityManager): Response { $wishlist = new Wishlist(); - $name = $request->get('name'); - $wishlist->setName($name); + $name = $request->get(key: 'name'); + $wishlist->setName(name: $name); $deadline = $request->get('deadline') ; $wishlist->setDeadline($deadline); $entityManager->persist($wishlist);