From e4f6aefdadc8222e68c12ed3889a257e36407c65 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 21 Aug 2018 23:26:12 -0700 Subject: [PATCH] Added self-checkout permission option --- app/Providers/AuthServiceProvider.php | 4 ++++ config/permissions.php | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index bff39fbf18..d5f1dbd582 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -139,6 +139,10 @@ class AuthServiceProvider extends ServiceProvider return $user->hasAccess('self.edit_location'); }); + Gate::define('self.checkout_assets', function($user) { + return $user->hasAccess('self.checkout_assets'); + }); + Gate::define('backend.interact', function ($user) { return $user->can('view', Statuslabel::class) || $user->can('view', AssetModel::class) diff --git a/config/permissions.php b/config/permissions.php index 2950391808..0550886167 100644 --- a/config/permissions.php +++ b/config/permissions.php @@ -578,6 +578,13 @@ return array( 'display' => true, ), + array( + 'permission' => 'self.checkout_assets', + 'label' => 'Self-Checkout', + 'note' => 'This user may check out assets that are marked for self-checkout.', + 'display' => true, + ), + ),