From f1fa5bdaa9a989439697705ff5d73ecad503852f Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 13 Feb 2019 04:56:13 -0800 Subject: [PATCH] =?UTF-8?q?Fixed=20(develop)=20#6704=20-=20don=E2=80=99t?= =?UTF-8?q?=20apply=20gate=20to=20$arrays=20collection,=20just=20check=20t?= =?UTF-8?q?hat=20they=20can=20view=20assets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/AssetsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index b746a6f989..60341b0547 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -306,9 +306,9 @@ class AssetsController extends Controller */ public function showBySerial($serial) { + $this->authorize('index', Asset::class); if ($assets = Asset::with('assetstatus')->with('assignedTo') ->withTrashed()->where('serial',$serial)->get()) { - $this->authorize('view', $assets); return (new AssetsTransformer)->transformAssets($assets, $assets->count()); } return response()->json(Helper::formatStandardApiResponse('error', null, 'Asset not found'), 200);