Merge remote-tracking branch 'origin/master' into develop

Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/permissions.php
This commit is contained in:
snipe 2022-05-12 09:31:42 -07:00
commit ef1eb15a91
3 changed files with 21 additions and 7 deletions

View file

@ -5,6 +5,7 @@ namespace App\Http\Controllers\Kits;
use App\Http\Controllers\CheckInOutRequest; use App\Http\Controllers\CheckInOutRequest;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\PredefinedKit; use App\Models\PredefinedKit;
use App\Models\Asset;
use App\Models\PredefinedLicence; use App\Models\PredefinedLicence;
use App\Models\PredefinedModel; use App\Models\PredefinedModel;
use App\Models\User; use App\Models\User;

View file

@ -83,6 +83,18 @@ abstract class SnipePermissionsPolicy
return $user->hasAccess($this->columnName().'.edit'); 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. * Determine whether the user can delete the accessory.
* *

View file

@ -6,6 +6,7 @@
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
return [ return [
'Global' => [ 'Global' => [
@ -97,6 +98,7 @@ return [
'display' => true, 'display' => true,
], ],
[ [
'permission' => 'assets.view.requestable', 'permission' => 'assets.view.requestable',
'label' => 'View Requestable Assets', 'label' => 'View Requestable Assets',
@ -178,6 +180,7 @@ return [
], ],
], ],
'Licenses' => [ 'Licenses' => [
[ [
'permission' => 'licenses.view', 'permission' => 'licenses.view',
@ -223,6 +226,7 @@ return [
], ],
], ],
'Components' => [ 'Components' => [
[ [
'permission' => 'components.view', 'permission' => 'components.view',
@ -288,13 +292,6 @@ return [
'note' => '', 'note' => '',
'display' => true, 'display' => true,
], ],
[
'permission' => 'kits.checkout',
'label' => 'Checkout ',
'note' => '',
'display' => true,
],
], ],
'Users' => [ 'Users' => [
@ -488,6 +485,7 @@ return [
], ],
], ],
'Manufacturers' => [ 'Manufacturers' => [
[ [
'permission' => 'manufacturers.view', 'permission' => 'manufacturers.view',
@ -596,6 +594,9 @@ return [
], ],
], ],
'Self' => [ 'Self' => [
[ [
'permission' => 'self.two_factor', 'permission' => 'self.two_factor',