mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
Merge pull request #11058 from snipe/fixes/kit_permissions
Fixed kit checkout permissions if admin is not superadmin
This commit is contained in:
commit
722e88a472
|
@ -4,6 +4,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;
|
||||||
|
|
|
@ -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.
|
||||||
*
|
*
|
||||||
|
|
|
@ -292,13 +292,6 @@ return array(
|
||||||
'note' => '',
|
'note' => '',
|
||||||
'display' => true,
|
'display' => true,
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
|
||||||
'permission' => 'kits.checkout',
|
|
||||||
'label' => 'Checkout ',
|
|
||||||
'note' => '',
|
|
||||||
'display' => true,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue