Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving authorization policies registration #528

Open
1 task done
Marlysson opened this issue Feb 14, 2022 · 1 comment
Open
1 task done

Improving authorization policies registration #528

Marlysson opened this issue Feb 14, 2022 · 1 comment

Comments

@Marlysson
Copy link
Contributor

Marlysson commented Feb 14, 2022

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

  • 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))
@Marlysson Marlysson changed the title Change signature of Policies register in provider Change signature of how Policies are registered in provider Feb 14, 2022
@girardinsamuel
Copy link
Contributor

I will think about this 😉

@girardinsamuel girardinsamuel changed the title Change signature of how Policies are registered in provider Improving authorization policies registration May 18, 2022
@josephmancuso josephmancuso self-assigned this Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants