Creating permissions for custom page

Solved
alejandro-rueda

Apr 4th, 2020 05:44 PM

I tried to create a permission for custom page, but always get 403 error, I did all Create permission, Set Role , but when I try to customize the controller, I don't know where to put this... ** protected function guard() { return Auth::guard(app('VoyagerGuard')); } ** Please help!!!

cookie

Apr 10th, 2020 10:37 PM

You can put your authorize Code directly in your Controller Method. Something like this:

$this->authorize('read', $page);

or:

auth()->user()->can('read', $page);

You know what I mean?

alejandro-rueda

Apr 13th, 2020 07:05 PM

Best Answer

I know what was my error.... In the Controller I wrote

$this->authorize(browse_import); And has to be $this->authorize('browse_import'); The problem was in the Apostrophe

Thanks!!!