From 7bf9a7435c8952c294c33dd0346e6a9c9a1ed304 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Tue, 14 Apr 2020 05:23:21 +0000 Subject: [PATCH] Bug fix for access. Add API logging to CMB services to avoid breakage. #377 --- config/cmb.services.yaml | 5 +++++ config/menu.yaml | 4 ---- config/services.yaml | 2 +- src/Controller/CustomerController.php | 8 +++----- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/config/cmb.services.yaml b/config/cmb.services.yaml index d12b2acf..2c4accff 100644 --- a/config/cmb.services.yaml +++ b/config/cmb.services.yaml @@ -227,3 +227,8 @@ services: $redis_prov: "@App\\Service\\RedisClientProvider" $loc_key: "%env(LOCATION_RIDER_ACTIVE_KEY)%" $status_key: "%env(STATUS_RIDER_KEY)%" + + # API logging + App\EventSubscriber\LogSubscriber: + arguments: + $api_log_flag: "%env(API_LOGGING)%" diff --git a/config/menu.yaml b/config/menu.yaml index 45ceab40..b0096cf5 100644 --- a/config/menu.yaml +++ b/config/menu.yaml @@ -122,10 +122,6 @@ main_menu: acl: jo_all.list label: View All parent: joborder - - id: jo_autoassign - acl: jo_autoassign.test - label: Autoassign Test - parent: joborder - id: support acl: support.menu diff --git a/config/services.yaml b/config/services.yaml index 4bfaf95a..3dbf1a91 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -231,7 +231,7 @@ services: App\Service\InventoryManager: arguments: $api_url: "%env(INVENTORY_API_URL)%" - $api_ocp_key: "%env(INVENTORY_API_OCP)%" + $api_ocp_key: "%env(INVENTORY_API_OCP)%" $api_auth_prefix: "%env(INVENTORY_API_AUTH_TOKEN_PREFIX)%" $api_auth_token: "%env(INVENTORY_API_AUTH_TOKEN)%" diff --git a/src/Controller/CustomerController.php b/src/Controller/CustomerController.php index fd9417cc..7030cde7 100644 --- a/src/Controller/CustomerController.php +++ b/src/Controller/CustomerController.php @@ -181,15 +181,13 @@ class CustomerController extends Controller public function getCustomerVehicles(Request $req, CustomerHandlerInterface $cust_handler) { - /* - // TODO: fix - if ((!$this->isGranted('jo_onestep.form')) || + if (!((!$this->isGranted('jo_onestep.form')) || (!$this->isGranted('jo_walkin.form')) || - (!$this->isGranted('jo_in.list'))) { + (!$this->isGranted('jo_in.list')))) + { $exception = $this->createAccessDeniedException('No access.'); throw $exception; } - */ $results = $cust_handler->getCustomerVehicles($req);