mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 22:37:28 -08:00
Merge pull request #10772 from snipe/fixes/use_correct_gate_for_maintainances
Use “update” instead of edit in gate
This commit is contained in:
commit
698b7301b6
|
@ -102,7 +102,7 @@ class AssetMaintenancesController extends Controller
|
||||||
*/
|
*/
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
$this->authorize('edit', Asset::class);
|
$this->authorize('update', Asset::class);
|
||||||
// create a new model instance
|
// create a new model instance
|
||||||
$assetMaintenance = new AssetMaintenance();
|
$assetMaintenance = new AssetMaintenance();
|
||||||
$assetMaintenance->supplier_id = $request->input('supplier_id');
|
$assetMaintenance->supplier_id = $request->input('supplier_id');
|
||||||
|
@ -155,7 +155,7 @@ class AssetMaintenancesController extends Controller
|
||||||
*/
|
*/
|
||||||
public function update(Request $request, $assetMaintenanceId = null)
|
public function update(Request $request, $assetMaintenanceId = null)
|
||||||
{
|
{
|
||||||
$this->authorize('edit', Asset::class);
|
$this->authorize('update', Asset::class);
|
||||||
// Check if the asset maintenance exists
|
// Check if the asset maintenance exists
|
||||||
$assetMaintenance = AssetMaintenance::findOrFail($assetMaintenanceId);
|
$assetMaintenance = AssetMaintenance::findOrFail($assetMaintenanceId);
|
||||||
|
|
||||||
|
@ -219,7 +219,7 @@ class AssetMaintenancesController extends Controller
|
||||||
*/
|
*/
|
||||||
public function destroy($assetMaintenanceId)
|
public function destroy($assetMaintenanceId)
|
||||||
{
|
{
|
||||||
$this->authorize('edit', Asset::class);
|
$this->authorize('update', Asset::class);
|
||||||
// Check if the asset maintenance exists
|
// Check if the asset maintenance exists
|
||||||
$assetMaintenance = AssetMaintenance::findOrFail($assetMaintenanceId);
|
$assetMaintenance = AssetMaintenance::findOrFail($assetMaintenanceId);
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ class AssetMaintenancesController extends Controller
|
||||||
*/
|
*/
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
$this->authorize('edit', Asset::class);
|
$this->authorize('update', Asset::class);
|
||||||
$asset = null;
|
$asset = null;
|
||||||
|
|
||||||
if ($asset = Asset::find(request('asset_id'))) {
|
if ($asset = Asset::find(request('asset_id'))) {
|
||||||
|
@ -98,7 +98,7 @@ class AssetMaintenancesController extends Controller
|
||||||
*/
|
*/
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
$this->authorize('edit', Asset::class);
|
$this->authorize('update', Asset::class);
|
||||||
// create a new model instance
|
// create a new model instance
|
||||||
$assetMaintenance = new AssetMaintenance();
|
$assetMaintenance = new AssetMaintenance();
|
||||||
$assetMaintenance->supplier_id = $request->input('supplier_id');
|
$assetMaintenance->supplier_id = $request->input('supplier_id');
|
||||||
|
@ -151,7 +151,7 @@ class AssetMaintenancesController extends Controller
|
||||||
*/
|
*/
|
||||||
public function edit($assetMaintenanceId = null)
|
public function edit($assetMaintenanceId = null)
|
||||||
{
|
{
|
||||||
$this->authorize('edit', Asset::class);
|
$this->authorize('update', Asset::class);
|
||||||
// Check if the asset maintenance exists
|
// Check if the asset maintenance exists
|
||||||
if (is_null($assetMaintenance = AssetMaintenance::find($assetMaintenanceId))) {
|
if (is_null($assetMaintenance = AssetMaintenance::find($assetMaintenanceId))) {
|
||||||
// Redirect to the improvement management page
|
// Redirect to the improvement management page
|
||||||
|
@ -204,7 +204,7 @@ class AssetMaintenancesController extends Controller
|
||||||
*/
|
*/
|
||||||
public function update(Request $request, $assetMaintenanceId = null)
|
public function update(Request $request, $assetMaintenanceId = null)
|
||||||
{
|
{
|
||||||
$this->authorize('edit', Asset::class);
|
$this->authorize('update', Asset::class);
|
||||||
// Check if the asset maintenance exists
|
// Check if the asset maintenance exists
|
||||||
if (is_null($assetMaintenance = AssetMaintenance::find($assetMaintenanceId))) {
|
if (is_null($assetMaintenance = AssetMaintenance::find($assetMaintenanceId))) {
|
||||||
// Redirect to the asset maintenance management page
|
// Redirect to the asset maintenance management page
|
||||||
|
@ -271,7 +271,7 @@ class AssetMaintenancesController extends Controller
|
||||||
*/
|
*/
|
||||||
public function destroy($assetMaintenanceId)
|
public function destroy($assetMaintenanceId)
|
||||||
{
|
{
|
||||||
$this->authorize('edit', Asset::class);
|
$this->authorize('update', Asset::class);
|
||||||
// Check if the asset maintenance exists
|
// Check if the asset maintenance exists
|
||||||
if (is_null($assetMaintenance = AssetMaintenance::find($assetMaintenanceId))) {
|
if (is_null($assetMaintenance = AssetMaintenance::find($assetMaintenanceId))) {
|
||||||
// Redirect to the asset maintenance management page
|
// Redirect to the asset maintenance management page
|
||||||
|
|
Loading…
Reference in a new issue