mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
One more time…. Fixed #6704 - don’t apply gate to $arrays collection, just check that they can view assets
This commit is contained in:
parent
30b1cfabf5
commit
aa1e06f021
|
@ -305,9 +305,10 @@ 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);
|
||||
|
|
Loading…
Reference in a new issue