Skip to content

Commit

Permalink
Add condition in LicenseCheckinController:bulkCheckin method to evalu…
Browse files Browse the repository at this point in the history
…ate if the license is reassignable
  • Loading branch information
inietov committed Aug 23, 2023
1 parent d393bd5 commit 6161a0d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/Http/Controllers/Licenses/LicenseCheckinController.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ public function bulkCheckin(Request $request, $licenseId) {
$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')
Expand Down

0 comments on commit 6161a0d

Please sign in to comment.