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

Split this into two methods? #746

Open
ioquatix opened this issue Oct 13, 2022 · 0 comments
Open

Split this into two methods? #746

ioquatix opened this issue Oct 13, 2022 · 0 comments
Labels
simmering undecided but generally optimistic

Comments

@ioquatix
Copy link
Contributor

It would be nice if this method either returned the policy class checked, or if there was some way to determine this without re-implementing the policy lookup logic.

def authorize(user, possibly_namespaced_record, query, policy_class: nil, cache: {})

One way would be to split this into two methods:

  • Map incoming arguments to a policy.
  • Raise an exception if the policy isn't satisified.

Would you accept a PR for this?

@Burgestrand Burgestrand added the simmering undecided but generally optimistic label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
simmering undecided but generally optimistic
Projects
None yet
Development

No branches or pull requests

2 participants