AuthorizeResource method for PendingResourceRegistration #43964
Unanswered
JesseKoper
asked this question in
Ideas
Replies: 1 comment
-
Looks like a handy idea! Anyone else would like to see a PR for this? |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently the only two ways to authorize a resource controller are to either add:
In the constructor of the controller, or:
In the specific methods.
The only way to do this in the route files is to write all your routes separately and use the
->can()
method for example. As far as I am aware at least.I've been experimenting with an
->authorizeResource()
option on the resource directly, that functions the same way as the constructor option. For example:This seems to work quite nicely, and I'm wondering if this is something I should try and make a PR for, or if this is more suitable as a package.
Beta Was this translation helpful? Give feedback.
All reactions