masonite
masonite copied to clipboard
Improving authorization policies registration
Is your feature request related to a problem? Please describe. Instead of passing a list of tuples, with this change is passed a Policy instance with related model injected.
What do we currently have to do now? Change Policy signature
Describe the solution you'd like Passing the user into policy constructor
- [x] Is this a breaking change?
Additional context Change signature of how register policies:
From
Gate.register_policies([(Model1, Policy1), (Model2, Policy)])
To:
Gate.register_policies(Policy1(Model1), Policy2(Model2))
I will think about this 😉