mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-24 04:03:34 -08:00
Fixed (develop) #6704 - don’t apply gate to $arrays collection, just check that they can view assets
This commit is contained in:
parent
2768ea692e
commit
f1fa5bdaa9
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue