From 332b6d7dd0e770965f7c5de60c0465c24403f6e8 Mon Sep 17 00:00:00 2001 From: shibafu Date: Mon, 14 Oct 2019 02:24:39 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=93=E3=81=A3=E3=81=A1=E3=81=AE=E3=81=BB?= =?UTF-8?q?=E3=81=86=E3=81=8C=E3=83=9E=E3=82=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/EjaculationController.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/EjaculationController.php b/app/Http/Controllers/EjaculationController.php index aa770ca..d509bdb 100644 --- a/app/Http/Controllers/EjaculationController.php +++ b/app/Http/Controllers/EjaculationController.php @@ -106,9 +106,7 @@ class EjaculationController extends Controller { $ejaculation = Ejaculation::findOrFail($id); - if (Auth::user()->cant('edit', $ejaculation)) { - abort(403); - } + $this->authorize('edit', $ejaculation); return view('ejaculation.edit')->with(compact('ejaculation')); } @@ -117,9 +115,7 @@ class EjaculationController extends Controller { $ejaculation = Ejaculation::findOrFail($id); - if (Auth::user()->cant('edit', $ejaculation)) { - abort(403); - } + $this->authorize('edit', $ejaculation); $inputs = $request->all(); @@ -172,9 +168,7 @@ class EjaculationController extends Controller { $ejaculation = Ejaculation::findOrFail($id); - if (Auth::user()->cant('edit', $ejaculation)) { - abort(403); - } + $this->authorize('edit', $ejaculation); $user = User::findOrFail($ejaculation->user_id); $ejaculation->tags()->detach();