Skip to content

Commit

Permalink
Merge pull request #10498 from Haxatron/master
Browse files Browse the repository at this point in the history
Fix access control
  • Loading branch information
snipe committed Jan 11, 2022
2 parents b78e610 + bb09564 commit cf14a02
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/Http/Controllers/BulkAssetModelsController.php
Expand Up @@ -32,6 +32,7 @@ public function edit(Request $request)

// 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) {
Expand All @@ -42,7 +43,7 @@ public function edit(Request $request)

// 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())
Expand All @@ -63,7 +64,8 @@ public function edit(Request $request)
*/
public function update(Request $request)
{

$this->authorize('update', AssetModel::class);

$models_raw_array = $request->input('ids');
$update_array = array();

Expand Down Expand Up @@ -103,6 +105,8 @@ public function update(Request $request)
*/
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)) {
Expand Down

0 comments on commit cf14a02

Please sign in to comment.