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

Decouple PolicyWonk.Policy from Plug.Conn #14

Open
pepicrft opened this issue Sep 23, 2023 · 0 comments
Open

Decouple PolicyWonk.Policy from Plug.Conn #14

pepicrft opened this issue Sep 23, 2023 · 0 comments

Comments

@pepicrft
Copy link

In my Phoenix apps I differentiate between business logic that's web-agnostic, and logic that's web-aware and that depends on web building blocks such as Plug.Conn. This is also the approach that Phoenix proposes by default when you create a new project.

In that world, it'd be very useful if PolicyWonk.Policy was web-agnostic too. According to the documentation, PolicyWonk.Enforce is the module that webifies a policy, but the PolicyWonk.Policy is already coupled to web through the function policy_error, which I'd expect to be a requirement of Policy.Enforce and not PolicyWonk.Policy. Is this a change you'd accept in the project? If so, I'd be happy to make the contribution with any necessary guidelines.

Thanks in advance :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant