Aaaaand one more for #2810. Sigh.

This commit is contained in:
snipe 2017-12-08 14:33:12 -08:00
parent e1423bd9d9
commit f90271dae5

View file

@ -362,7 +362,14 @@ class LicensesController extends Controller
// Redirect to the asset management page with error // Redirect to the asset management page with error
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.not_found')); 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); return view('licenses/checkin', compact('licenseSeat'))->with('backto', $backTo);
} }
@ -386,8 +393,7 @@ class LicensesController extends Controller
} }
$license = License::find($licenseSeat->license_id); $license = License::find($licenseSeat->license_id);
$this->authorize('checkout', $license);
$this->authorize('checkin', $license);
if (!$license->reassignable) { if (!$license->reassignable) {
// Not allowed to checkin // Not allowed to checkin