Skip to content

Commit 8d24c0a

Browse files
authored
Merge pull request #15982 from spencerrlongg/bug/sc-27228
Update Checkout Button Permission for Predefined Kits
2 parents 174a01c + 7eb9368 commit 8d24c0a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

app/Http/Transformers/PredefinedKitsTransformer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Http\Transformers;
44

55
use App\Helpers\Helper;
6+
use App\Models\Asset;
67
use App\Models\PredefinedKit;
78
use App\Models\SnipeModel;
89
use Illuminate\Support\Facades\Gate;
@@ -42,7 +43,7 @@ public function transformPredefinedKit(PredefinedKit $kit)
4243
$permissions_array['available_actions'] = [
4344
'update' => Gate::allows('update', PredefinedKit::class),
4445
'delete' => Gate::allows('delete', PredefinedKit::class),
45-
'checkout' => Gate::allows('checkout', PredefinedKit::class),
46+
'checkout' => Gate::allows('checkout', Asset::class),
4647
// 'clone' => Gate::allows('create', PredefinedKit::class),
4748
// 'restore' => Gate::allows('create', PredefinedKit::class),
4849
];

resources/views/partials/bootstrap-table.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ function genericActionsFormatter(owner_name, element_name) {
279279
element_name = '';
280280
}
281281
282-
return function (value,row) {
283282
283+
return function (value,row) {
284284
var actions = '<nobr>';
285285
286286
// Add some overrides for any funny urls we have
@@ -441,7 +441,7 @@ function licenseSeatInOutFormatter(value, row) {
441441
}
442442
443443
function genericCheckinCheckoutFormatter(destination) {
444-
return function (value,row) {
444+
return function (value, row) {
445445
446446
// The user is allowed to check items out, AND the item is deployable
447447
if ((row.available_actions.checkout == true) && (row.user_can_checkout == true) && ((!row.asset_id) && (!row.assigned_to))) {

0 commit comments

Comments
 (0)