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

Include policy name in NotAuthorizedError message #681

Closed
wants to merge 1 commit into from

Commits on Aug 3, 2021

  1. Modified NotAuthorizedError default message

    record is sometimes an Object, sometimes a Class and sometimes an Array. Use the policy instead in the error message.
    
    e.g.
    ```
    authorize(Post.first)
    before: not allowed to destroy? this Post
    after : not allowed to destroy? with PostPolicy
    ```
    
    ```
    authorize([:project, Post.first])
    before: not allowed to destroy? this Array
    after : not allowed to destroy? with Project::PostPolicy
    ```
    langsharpe committed Aug 3, 2021
    Configuration menu
    Copy the full SHA
    4f1a10d View commit details
    Browse the repository at this point in the history