- Fixed an issue where controller-wide
grant_access
calls would overwrite each other instead of being additive, causing inconsistent access control based on statement order
- Minor performance improvement for authorization checks
- Added
Rabarber::Role.all_names
method to retrieve all roles available in the application, grouped by context - Added
Rabarber::HasRoles#all_roles
method to retrieve all roles assigned to a user, grouped by context
- Fixed potential bug in role revocation caused by checking for the presence of a role in the cache instead of the database
- Added support for Ruby 3.4
- Updated some error messages for clarity
- Resolved an issue preventing Rabarber from being used with the RBS Rails gem
- Dropped support for Ruby 3.0
- Dropped support for Rails 6.1
- Added support for Rails 8.0
- Improved performance for authorization checks
- Refactored codebase for better maintainability
- Added support for Rails 7.2
- Updated gemspec file to include missing metadata
- Changed Rabarber roles table structure
To upgrade to v3.0.0, please refer to the migration guide
- Introduced the ability to define and authorize roles within a specific context
- Revised log messages in the audit trail for clarity and conciseness
- Added
Rabarber::Authorization.skip_authorization
method to skip authorization checks
- Removed
when_actions_missing
andwhen_roles_missing
configuration options - Replaced
when_unauthorized
configuration option with an overridable controller method - Renamed
Rabarber::Role.assignees_for
method toRabarber::Role.assignees
To upgrade to v2.0.0, please refer to the migration guide
- Added support for UUID primary keys
- Fixed the issue where an error would occur when using view helpers if the user was not authenticated
- Significant refactoring and code improvements
- Fix an issue where an error could be raised when using controller-wide dynamic rules
- Add 'Audit trail' feature: Logging of role assignments, revocations, and unauthorized access attempts
- Add
audit_trail_enabled
configuration option, allowing to enable or disable the audit trail - Deprecate
when_actions_missing
andwhen_roles_missing
configuration options (see the discussion)
- Add
Rabarber::Role.assignees_for
method - Fix inconsistent behavior where passing
nil
as a role name to role management methods would raise anActiveRecord
error instead ofRabarber
error - Various minor code improvements
- Add methods to directly add, rename, and remove roles
- Modify
Rabarber::HasRoles#assign_roles
andRabarber::HasRoles#revoke_roles
methods to return the list of roles assigned to the user - Minor performance improvements
- Refactor to improve readability and maintainability
- Fix minor code errors
- Cache roles to avoid unnecessary database queries
- Introduce
cache_enabled
configuration option allowing to enable or disable role caching - Enhance the migration generator so that it can receive the table name of the model representing users in the application as an argument
- Fix an issue where an error would be raised if the user is not authenticated
- Various minor improvements
- Enhance handling of missing actions and roles specified in
grant_access
method by raising an error for missing actions and logging a warning for missing roles - Introduce
when_actions_missing
andwhen_roles_missing
configuration options, allowing to customize the behavior when actions or roles are not found
- Add support for
unless
argument ingrant_access
method, allowing to define negated dynamic rules - Fix a bug where specifying a dynamic rule as a symbol without specifying an action would result in an error
- Add co-author: trafium
- Allow to use strings as role names
- Enhance clarity by improving error types and messages
- Resolve inconsistency in types of role names
- Various enhancements for gem development and release
- Modify
Rabarber::HasRoles#roles
method to return an array of role names instead ofRabarber::Role
objects
- Various enhancements for gem development
- Drop support for Ruby 2.7
- Add support for Ruby 3.3
- Various minor improvements
- Add missing
foreign_key
option toCreateRabarberRoles
migration - Allow only lowercase alphanumeric characters and underscores in role names
- Remove
Rabarber::HasRoles#role?
method as unnecessary
- Fully revise and update README for clarity
- Fix check that
Rabarber::HasRoles
can only be included once
- Initial release