Fix the PIREP edit permissions

This commit is contained in:
Nabeel Shahzad
2021-04-01 09:54:01 -04:00
parent 3f84f84309
commit ede71e6927
2 changed files with 16 additions and 12 deletions

View File

@@ -5,20 +5,10 @@ namespace App\Http\Requests;
use App\Contracts\FormRequest;
use App\Models\Pirep;
use App\Repositories\PirepFieldRepository;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
class UpdatePirepRequest extends FormRequest
{
/**
* Is the user allowed to do this?
*/
public function authorize(): bool
{
$pirep = Pirep::findOrFail($this->route('pirep'), ['user_id']);
return $pirep->user_id === Auth::id();
}
/**
* Get the validation rules that apply to the request.
*