Allow additional arguments on Filament\authorize()
to be passed on Laravel\authorize()
#14130
juliomotol
started this conversation in
Ideas
Replies: 1 comment
-
Hey @danharrin I was going to propose the same idea and then searched and found this. I also faced the same limit when I was trying to authorize more complex policies in my app. Sometimes you need to pass more arguments to your Policy to authorize an action. By default, Laravel allows this by passing the arguments as an array instead of the model object itself. I think it would be a good addition to Filament as well. |
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
-
Given the ff policy:
In our case, we have different Resources for each type of Post (don't ask me why, I suggested to just use filters but the client insisted on separating each type), and certain users may only have access on certain types of Posts
At the moment, Filament's authorize method is unable to pass a $type argument to the policy method unlike in Laravel's authorize method.
See #14121 for more info.
Beta Was this translation helpful? Give feedback.
All reactions