mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-13 06:47:46 -08:00
Moved gate
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
dac877f184
commit
473553c464
|
@ -236,16 +236,16 @@ class LocationsController extends Controller
|
||||||
* @since [v6.0.14]
|
* @since [v6.0.14]
|
||||||
* @return View
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function getClone($licenseId = null)
|
public function getClone($locationId = null)
|
||||||
{
|
{
|
||||||
|
$this->authorize('create', Location::class);
|
||||||
|
|
||||||
// Check if the asset exists
|
// Check if the asset exists
|
||||||
if (is_null($location_to_clone = Location::find($licenseId))) {
|
if (is_null($location_to_clone = Location::find($locationId))) {
|
||||||
// Redirect to the asset management page
|
// Redirect to the asset management page
|
||||||
return redirect()->route('licenses.index')->with('error', trans('admin/locations/message.does_not_exist'));
|
return redirect()->route('licenses.index')->with('error', trans('admin/locations/message.does_not_exist'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->authorize('create', $location_to_clone);
|
|
||||||
|
|
||||||
$location = clone $location_to_clone;
|
$location = clone $location_to_clone;
|
||||||
$location->id = null;
|
$location->id = null;
|
||||||
$location->name = null;
|
$location->name = null;
|
||||||
|
|
Loading…
Reference in a new issue