mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
Aaaaand one more for #2810. Sigh.
This commit is contained in:
parent
e1423bd9d9
commit
f90271dae5
|
@ -362,7 +362,14 @@ class LicensesController extends Controller
|
|||
// Redirect to the asset management page with error
|
||||
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.not_found'));
|
||||
}
|
||||
$this->authorize('checkin', $licenseSeat);
|
||||
|
||||
if (is_null($license = License::find($licenseSeat->license_id))) {
|
||||
// Redirect to the asset management page with error
|
||||
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.not_found'));
|
||||
}
|
||||
|
||||
|
||||
$this->authorize('checkout', $license);
|
||||
return view('licenses/checkin', compact('licenseSeat'))->with('backto', $backTo);
|
||||
}
|
||||
|
||||
|
@ -386,8 +393,7 @@ class LicensesController extends Controller
|
|||
}
|
||||
|
||||
$license = License::find($licenseSeat->license_id);
|
||||
|
||||
$this->authorize('checkin', $license);
|
||||
$this->authorize('checkout', $license);
|
||||
|
||||
if (!$license->reassignable) {
|
||||
// Not allowed to checkin
|
||||
|
|
Loading…
Reference in a new issue