From b2c410f85aa0bbca192604dd7cd570aa4625ab4a Mon Sep 17 00:00:00 2001 From: babak alizadeh Date: Sun, 11 Feb 2024 13:24:19 +0000 Subject: [PATCH] bug fix in sell controller --- .../src/Controller/MoadiyanController.php | 18 ++++++++++++++++++ hesabixCore/src/Controller/SellController.php | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 hesabixCore/src/Controller/MoadiyanController.php diff --git a/hesabixCore/src/Controller/MoadiyanController.php b/hesabixCore/src/Controller/MoadiyanController.php new file mode 100644 index 0000000..c83a1b2 --- /dev/null +++ b/hesabixCore/src/Controller/MoadiyanController.php @@ -0,0 +1,18 @@ +render('moadiyan/index.html.twig', [ + 'controller_name' => 'MoadiyanController', + ]); + } +} diff --git a/hesabixCore/src/Controller/SellController.php b/hesabixCore/src/Controller/SellController.php index 2889387..9bbd7c2 100644 --- a/hesabixCore/src/Controller/SellController.php +++ b/hesabixCore/src/Controller/SellController.php @@ -20,7 +20,7 @@ class SellController extends AbstractController public function app_buy_can_edit(Request $request,Access $access,Log $log,EntityManagerInterface $entityManager, string $code): JsonResponse { $canEdit = true; - $acc = $access->hasRole('buy'); + $acc = $access->hasRole('sell'); if(!$acc) throw $this->createAccessDeniedException(); @@ -44,7 +44,7 @@ class SellController extends AbstractController #[Route('/api/sell/get/info/{code}', name: 'app_buy_get_info')] public function app_buy_get_info(Request $request,Access $access,Log $log,EntityManagerInterface $entityManager, string $code): JsonResponse { - $acc = $access->hasRole('buy'); + $acc = $access->hasRole('sell'); if(!$acc) throw $this->createAccessDeniedException(); $doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([