From 473553c464fa61f008206aa33085d058d4c2bc64 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 1 Mar 2023 14:01:40 -0800 Subject: [PATCH] Moved gate Signed-off-by: snipe --- app/Http/Controllers/LocationsController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/LocationsController.php b/app/Http/Controllers/LocationsController.php index 25a500b567..adbe173c66 100755 --- a/app/Http/Controllers/LocationsController.php +++ b/app/Http/Controllers/LocationsController.php @@ -236,16 +236,16 @@ class LocationsController extends Controller * @since [v6.0.14] * @return View */ - public function getClone($licenseId = null) + public function getClone($locationId = null) { + $this->authorize('create', Location::class); + // Check if the asset exists - if (is_null($location_to_clone = Location::find($licenseId))) { + if (is_null($location_to_clone = Location::find($locationId))) { // Redirect to the asset management page return redirect()->route('licenses.index')->with('error', trans('admin/locations/message.does_not_exist')); } - $this->authorize('create', $location_to_clone); - $location = clone $location_to_clone; $location->id = null; $location->name = null;