mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
authorization tested in request
This commit is contained in:
parent
d971172cf3
commit
3f834cb88f
|
@ -536,8 +536,6 @@ class AssetsController extends Controller
|
||||||
*/
|
*/
|
||||||
public function store(StoreAssetRequest $request)
|
public function store(StoreAssetRequest $request)
|
||||||
{
|
{
|
||||||
$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')));
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ class StoreAssetRequest extends ImageUploadRequest
|
||||||
*/
|
*/
|
||||||
public function authorize(): bool
|
public function authorize(): bool
|
||||||
{
|
{
|
||||||
// TODO: make sure this works
|
|
||||||
return Gate::allows('create', new Asset);
|
return Gate::allows('create', new Asset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue