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\Controller;
use App\Models\PredefinedKit;
use App\Models\Asset;
use App\Models\PredefinedLicence;
use App\Models\PredefinedModel;
use App\Models\User;

View file

@ -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.
*

View file

@ -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',