mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Added auth check back to asset store
This commit is contained in:
parent
1b047c768b
commit
d23ea70b08
|
@ -231,7 +231,8 @@ class AssetsController extends Controller
|
||||||
*/
|
*/
|
||||||
public function store(AssetRequest $request)
|
public function store(AssetRequest $request)
|
||||||
{
|
{
|
||||||
// $this->authorize('create', Asset::class);
|
|
||||||
|
$this->authorize('create', Asset::class);
|
||||||
|
|
||||||
$asset = new Asset();
|
$asset = new Asset();
|
||||||
$asset->model()->associate(AssetModel::find((int) $request->get('model_id')));
|
$asset->model()->associate(AssetModel::find((int) $request->get('model_id')));
|
||||||
|
@ -279,6 +280,7 @@ class AssetsController extends Controller
|
||||||
}
|
}
|
||||||
return response()->json(Helper::formatStandardApiResponse('success', $asset, trans('admin/hardware/message.create.success')));
|
return response()->json(Helper::formatStandardApiResponse('success', $asset, trans('admin/hardware/message.create.success')));
|
||||||
}
|
}
|
||||||
|
|
||||||
return response()->json(Helper::formatStandardApiResponse('error', null, $asset->getErrors()), 200);
|
return response()->json(Helper::formatStandardApiResponse('error', null, $asset->getErrors()), 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue