Merge pull request #13520 from inietov/fixes/licenses_reassignable_feature

Fixed Not reassignable Licenses shouldn't show 'Checkin All Seats' button [sc-23506]
This commit is contained in:
snipe
2023-09-14 12:52:13 +01:00
committed by GitHub
3 changed files with 21 additions and 7 deletions
@@ -128,6 +128,13 @@ class LicenseCheckinController extends Controller
$license = License::findOrFail($licenseId);
$this->authorize('checkin', $license);
if (! $license->reassignable) {
// Not allowed to checkin
Session::flash('error', 'License not reassignable.');
return redirect()->back()->withInput();
}
$licenseSeatsByUser = LicenseSeat::where('license_id', '=', $licenseId)
->whereNotNull('assigned_to')
->with('user')