Skip to content

Split this into two methods? #746

@ioquatix

Description

@ioquatix

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    simmeringundecided but generally optimistic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions