diff --git a/app/Http/Controllers/Kits/CheckoutKitController.php b/app/Http/Controllers/Kits/CheckoutKitController.php index 4370e51789..7a0f93391d 100644 --- a/app/Http/Controllers/Kits/CheckoutKitController.php +++ b/app/Http/Controllers/Kits/CheckoutKitController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Kits; use App\Http\Controllers\CheckInOutRequest; use App\Http\Controllers\Controller; use App\Models\PredefinedKit; +use App\Models\Asset; use App\Models\PredefinedLicence; use App\Models\PredefinedModel; use App\Models\User; diff --git a/app/Policies/SnipePermissionsPolicy.php b/app/Policies/SnipePermissionsPolicy.php index f6f6e4db82..703385ec99 100644 --- a/app/Policies/SnipePermissionsPolicy.php +++ b/app/Policies/SnipePermissionsPolicy.php @@ -83,6 +83,18 @@ abstract class SnipePermissionsPolicy return $user->hasAccess($this->columnName().'.edit'); } + + /** + * Determine whether the user can update the accessory. + * + * @param \App\Models\User $user + * @return mixed + */ + public function checkout(User $user, $item = null) + { + return $user->hasAccess($this->columnName().'.checkout'); + } + /** * Determine whether the user can delete the accessory. * diff --git a/config/permissions.php b/config/permissions.php index 57aa4a3232..2af54d615a 100644 --- a/config/permissions.php +++ b/config/permissions.php @@ -6,6 +6,7 @@ |-------------------------------------------------------------------------- */ + return [ 'Global' => [ @@ -97,6 +98,7 @@ return [ 'display' => true, ], + [ 'permission' => 'assets.view.requestable', 'label' => 'View Requestable Assets', @@ -178,6 +180,7 @@ return [ ], ], + 'Licenses' => [ [ 'permission' => 'licenses.view', @@ -223,6 +226,7 @@ return [ ], ], + 'Components' => [ [ 'permission' => 'components.view', @@ -288,13 +292,6 @@ return [ 'note' => '', 'display' => true, ], - - [ - 'permission' => 'kits.checkout', - 'label' => 'Checkout ', - 'note' => '', - 'display' => true, - ], ], 'Users' => [ @@ -488,6 +485,7 @@ return [ ], ], + 'Manufacturers' => [ [ 'permission' => 'manufacturers.view', @@ -596,6 +594,9 @@ return [ ], ], + + + 'Self' => [ [ 'permission' => 'self.two_factor',