Skip to content

Commit

Permalink
Update authorization check
Browse files Browse the repository at this point in the history
  • Loading branch information
Hasnayeen committed Jul 17, 2024
1 parent c6de27a commit 258174c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ protected function authorize()

return;
}

if (! Gate::getPolicyFor(static::$model)) {
return;
}

if (static::$model) {
$action = request()->route()->getActionMethod();
$model = static::$model;
$record = request()->route($model::getRouteKeyName());
$record = request()->route()->parameter(Str::kebab($model));

$policyMethod = $this->mapMethodToPolicy($action);

Expand Down

0 comments on commit 258174c

Please sign in to comment.