Authorizing wildcards and Gate::after()
#2180
juliomotol
started this conversation in
Show and tell
Replies: 0 comments
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.
-
Ok, hear me out, given the following wildcard permissions that follows the policies ability conventions:
productproduct.viewAnyproduct.viewproduct.createproduct.updateproduct.delete...and in somewhere in my service providers I have:
In theory, I could
$this->authorize('update', $product)in my controller without having to create aProductPolicy.And even if I do create a
ProductPolicywith a custom authorization like:...it would still respect the
ProductPolicyas I registered the magic inGate::after().I haven't tested this out yet, I'd like to know your thoughts on this. Lets discuss about it!
Beta Was this translation helpful? Give feedback.
All reactions