- Fixed a regression where NotAuthorizedError could not be ininitialized with a string.
- Use
camelizeinstead ofclassifyfor symbol policies to prevent weird pluralizations.
- Caches policy scopes and policies.
- Explicitly setting the policy for the controller via
controller.policy = foohas been removed. Instead usecontroller.policies[record] = foo. - Explicitly setting the policy scope for the controller via
controller.policy_policy = foohas been removed. Instead usecontroller.policy_scopes[scope] = foo. - Add
permitted_attributeshelper to fetch attributes from policy. - Add
pundit_policy_authorized?andpundit_policy_scoped?methods. - Instance variables are prefixed to avoid collisions.
- Add
Pundit.authorizemethod. - Add
skip_authorizationandskip_policy_scopehelpers. - Better errors when checking multiple permissions in RSpec tests.
- Better errors in case
nilis passed topolicyorpolicy_scope. - Use
inpectwhen printing object for better errors. - Dropped official support for Ruby 1.9.3
- Extend the default
ApplicationPolicywith anApplicationPolicy::Scope(#120) - Fix RSpec 3 deprecation warnings for built-in matchers (#162)
- Generate blank policy spec/test files for Rspec/MiniTest/Test::Unit in Rails (#138)
- Customizable error messages:
#query,#recordand#policymethods onPundit::NotAuthorizedError(#114) - Raise a different
Pundit::AuthorizationNotPerformedErrorwhenauthorizecall is expected in controller action but missing (#109) - Update Rspec matchers for Rspec 3 (#124)
- Customize the user to be passed into policies:
pundit_user(#42)