mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Update BulkAssetModelsController.php
https://huntr.dev/bounties/efdf2ead-f9d1-4767-9f02-d11f762d15e7
This commit is contained in:
parent
b78e610ce3
commit
bb095641c2
|
@ -32,6 +32,7 @@ class BulkAssetModelsController extends Controller
|
|||
|
||||
// If deleting....
|
||||
if ($request->input('bulk_actions')=='delete') {
|
||||
$this->authorize('delete', AssetModel::class);
|
||||
$valid_count = 0;
|
||||
foreach ($models as $model) {
|
||||
if ($model->assets_count == 0) {
|
||||
|
@ -42,7 +43,7 @@ class BulkAssetModelsController extends Controller
|
|||
|
||||
// Otherwise display the bulk edit screen
|
||||
}
|
||||
|
||||
$this->authorize('update', AssetModel::class);
|
||||
$nochange = ['NC' => 'No Change'];
|
||||
return view('models/bulk-edit', compact('models'))
|
||||
->with('fieldset_list', $nochange + Helper::customFieldsetList())
|
||||
|
@ -63,7 +64,8 @@ class BulkAssetModelsController extends Controller
|
|||
*/
|
||||
public function update(Request $request)
|
||||
{
|
||||
|
||||
$this->authorize('update', AssetModel::class);
|
||||
|
||||
$models_raw_array = $request->input('ids');
|
||||
$update_array = array();
|
||||
|
||||
|
@ -103,6 +105,8 @@ class BulkAssetModelsController extends Controller
|
|||
*/
|
||||
public function destroy(Request $request)
|
||||
{
|
||||
$this->authorize('delete', AssetModel::class);
|
||||
|
||||
$models_raw_array = $request->input('ids');
|
||||
|
||||
if ((is_array($models_raw_array)) && (count($models_raw_array) > 0)) {
|
||||
|
|
Loading…
Reference in a new issue