mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 22:07:29 -08:00
Fix asset creation with API and FullMultipleCompanySupport
It is currently possible to create an asset with arbitrary company without being superuser and FullMultipleCompanySupport enabled.
This bug goes back to 75ac7f80b9
which is part of version 6.3.0.
Fix this by restoring the previous behaviour to check the company_id with getIdForCurrentUser().
This commit is contained in:
parent
8aa298f6b0
commit
fb4fe30049
|
@ -598,6 +598,7 @@ class AssetsController extends Controller
|
|||
$asset->model()->associate(AssetModel::find((int) $request->get('model_id')));
|
||||
|
||||
$asset->fill($request->validated());
|
||||
$asset->company_id = Company::getIdForCurrentUser($request->validated()['company_id']);
|
||||
$asset->created_by = auth()->id();
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue