Merge pull request #11058 from snipe/fixes/kit_permissions

Fixed kit checkout permissions if admin is not superadmin
This commit is contained in:
snipe 2022-05-11 20:11:13 -07:00 committed by GitHub
commit 722e88a472
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View file

@ -4,6 +4,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

@ -292,13 +292,6 @@ return array(
'note' => '',
'display' => true,
),
array(
'permission' => 'kits.checkout',
'label' => 'Checkout ',
'note' => '',
'display' => true,
),
),