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
-
Ok, hear me out, given the following wildcard permissions that follows the policies ability conventions:
product
product.viewAny
product.view
product.create
product.update
product.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
ProductPolicy
with a custom authorization like:...it would still respect the
ProductPolicy
as 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