AuthorizeResource does not work in __construct method of RolesController #2229
Unanswered
illia-sapryga
asked this question in
Q&A
Replies: 1 comment
-
pretty sure, yes |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone.
I have created a resource RolesController which gives ability to my users to view, create, update, delete roles.
I am using spatie roles, permissions package.
I have an issue with
$this->authorizeResource()
method when I apply it in the __construct method of my RolesController. It does not seem to work, but it works perfectly fine with the rest of my resource controllers. Pretty much I get 403 whether the user has needed permissions or not. I am assuming that is because Role model is the spatie model that I am extending to add some functionality. So I am trying to understand if I am doing something wrong or this is just a bug of the package.Role.php
RolesController.php
Permissions migration
Beta Was this translation helpful? Give feedback.
All reactions