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

Remove duplication in pundit policies #2665

Closed
wants to merge 26 commits into from

Commits on Jan 29, 2024

  1. Configuration menu
    Copy the full SHA
    0cb81e0 View commit details
    Browse the repository at this point in the history
  2. Remove Roles::<class>#level

    This was only being used to order them but we now
    hardcode the order.
    chrisroos committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    5951247 View commit details
    Browse the repository at this point in the history
  3. Explicitly require roles

    chrisroos committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    f0ec514 View commit details
    Browse the repository at this point in the history
  4. Remove unused Roles::Base

    chrisroos committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    10fd8cd View commit details
    Browse the repository at this point in the history
  5. Extract Roles.all

    We don't make use of User.role_classes so let's remove it.
    chrisroos committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    b8c557b View commit details
    Browse the repository at this point in the history
  6. Extract Roles.names

    We don't make use of User.roles so let's remove it.
    chrisroos committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    12367ba View commit details
    Browse the repository at this point in the history
  7. Move User#role validation to User class

    As this is the only place it's used.
    chrisroos committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    82e4f54 View commit details
    Browse the repository at this point in the history
  8. Extract Roles.admin

    This is not used as User.admin_role_classes
    chrisroos committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    15058cd View commit details
    Browse the repository at this point in the history
  9. Extract Roles.admin_names

    chrisroos committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    d6eb388 View commit details
    Browse the repository at this point in the history
  10. Avoid metaprogramming

    chrisroos committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    981dc13 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    894f955 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    200d0c8 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    0d344a8 View commit details
    Browse the repository at this point in the history
  14. Move #role_class to Roles

    chrisroos committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    d8c63de View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    2cd32d9 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    8800e3f View commit details
    Browse the repository at this point in the history
  17. Remove explicit requires

    These should not be necessary now that we reference the classes directly
    from the Roles module.
    chrisroos committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    33c50fb View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    85ca5d2 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    3cd82da View commit details
    Browse the repository at this point in the history
  20. Extract Roles.find

    chrisroos committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    7580e96 View commit details
    Browse the repository at this point in the history
  21. Add #require_2sv? to roles

    chrisroos committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    592d8e5 View commit details
    Browse the repository at this point in the history
  22. Use Roles::<class>.require_2sv?

    Have to fallback to `false` in `invitee_requires_2sv` to prevent a
    database constraint violation attempting to insert `null` into
    `require_2sv`.
    chrisroos committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    60b42f3 View commit details
    Browse the repository at this point in the history
  23. Remove Roles.admin and .admin_names

    No longer used.
    chrisroos committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    8288ff9 View commit details
    Browse the repository at this point in the history
  24. Simplify Roles.find

    chrisroos committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    2bc2381 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    8d6a544 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    f9035b4 View commit details
    Browse the repository at this point in the history