From cd120288453ca65266345a341d8b6a10da87f495 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 3 Mar 2022 18:47:20 -0800 Subject: [PATCH 1/2] =?UTF-8?q?Use=20=E2=80=9Cupdate=E2=80=9D=20instead=20?= =?UTF-8?q?of=20edit=20in=20gate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: snipe --- app/Http/Controllers/AssetMaintenancesController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/AssetMaintenancesController.php b/app/Http/Controllers/AssetMaintenancesController.php index a833cddd34..400a950f1a 100644 --- a/app/Http/Controllers/AssetMaintenancesController.php +++ b/app/Http/Controllers/AssetMaintenancesController.php @@ -67,7 +67,7 @@ class AssetMaintenancesController extends Controller */ public function create() { - $this->authorize('edit', Asset::class); + $this->authorize('update', Asset::class); $asset = null; if ($asset = Asset::find(request('asset_id'))) { @@ -98,7 +98,7 @@ class AssetMaintenancesController extends Controller */ public function store(Request $request) { - $this->authorize('edit', Asset::class); + $this->authorize('update', Asset::class); // create a new model instance $assetMaintenance = new AssetMaintenance(); $assetMaintenance->supplier_id = $request->input('supplier_id'); @@ -151,7 +151,7 @@ class AssetMaintenancesController extends Controller */ public function edit($assetMaintenanceId = null) { - $this->authorize('edit', Asset::class); + $this->authorize('update', Asset::class); // Check if the asset maintenance exists if (is_null($assetMaintenance = AssetMaintenance::find($assetMaintenanceId))) { // Redirect to the improvement management page @@ -204,7 +204,7 @@ class AssetMaintenancesController extends Controller */ public function update(Request $request, $assetMaintenanceId = null) { - $this->authorize('edit', Asset::class); + $this->authorize('update', Asset::class); // Check if the asset maintenance exists if (is_null($assetMaintenance = AssetMaintenance::find($assetMaintenanceId))) { // Redirect to the asset maintenance management page @@ -271,7 +271,7 @@ class AssetMaintenancesController extends Controller */ public function destroy($assetMaintenanceId) { - $this->authorize('edit', Asset::class); + $this->authorize('update', Asset::class); // Check if the asset maintenance exists if (is_null($assetMaintenance = AssetMaintenance::find($assetMaintenanceId))) { // Redirect to the asset maintenance management page From c940d36fff61cc56348b0664275ea590478cca04 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 3 Mar 2022 18:49:54 -0800 Subject: [PATCH 2/2] Updated maintenance gate in API Signed-off-by: snipe --- app/Http/Controllers/Api/AssetMaintenancesController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Api/AssetMaintenancesController.php b/app/Http/Controllers/Api/AssetMaintenancesController.php index 4a07ab86ad..6d5db44f4e 100644 --- a/app/Http/Controllers/Api/AssetMaintenancesController.php +++ b/app/Http/Controllers/Api/AssetMaintenancesController.php @@ -102,7 +102,7 @@ class AssetMaintenancesController extends Controller */ public function store(Request $request) { - $this->authorize('edit', Asset::class); + $this->authorize('update', Asset::class); // create a new model instance $assetMaintenance = new AssetMaintenance(); $assetMaintenance->supplier_id = $request->input('supplier_id'); @@ -155,7 +155,7 @@ class AssetMaintenancesController extends Controller */ public function update(Request $request, $assetMaintenanceId = null) { - $this->authorize('edit', Asset::class); + $this->authorize('update', Asset::class); // Check if the asset maintenance exists $assetMaintenance = AssetMaintenance::findOrFail($assetMaintenanceId); @@ -219,7 +219,7 @@ class AssetMaintenancesController extends Controller */ public function destroy($assetMaintenanceId) { - $this->authorize('edit', Asset::class); + $this->authorize('update', Asset::class); // Check if the asset maintenance exists $assetMaintenance = AssetMaintenance::findOrFail($assetMaintenanceId);