- Updated
accessible_objects_for_operations_function
for better filter performance
– Execute bundle exec rails generate the_policy_machine:update_accessible_objects_filter_performance
and rerun
db:migrate
to use these changes.
- Updated PostgreSQL
operations_for_operation_sets
with performance improvements
- Updated PostgreSQL
operations_for_operation_sets
to guarantee disable mergejoin
- Support Rails 7.1
- Drop support for Rails < 7.1
- Allow prohibition operations to be created without workaround.
- Fallback to empty hash when extra_attributes are not set.
- Support ruby 3.
- Replaced
will_paginate
withkaminari
.
- Updated PostgreSQL
operations_for_operation_sets
CTE to pre-aggregateaccessible_operations
before joining topolicy_elements
for performance optimizations.
- Updated
accessible_objects_for_operations
code path to use a CTE when using a replica database.
- Updated PostgreSQL function
pm_accessible_objects_for_operations
to ensure uniqueness of results.
- Added a PostgreSQL function for
#accessible_objects
and#accessible_objects_for_operations
which are performance. optimized. Only supported for a singlefield
,direct_only
, andignore_prohibitions
.
– Execute bundle exec rails generate the_policy_machine:accessible_objects_for_operations_function
and rerun
db:migrate
to use these changes.
- Added
fields
option toPolicyMachineStorageAdapter::ActiveRecord
for#accessible_objects
and#accessible_objects_for_operations
to fetch only requested fields as a hash.
- Fixed a deprecation warning from Rails 6.1.
- Fixed incorrect handling of filters with prohibitions in ActiveRecord
accessible_objects_for_operations
.
- Fixed intermittent incorrect constant resolution.
- Added
PolicyMachine#all_operations_for_user_or_attr_and_objs_or_attrs
for finding a map of all operations between given objects and a given user. - Added
PM::Operation.prohibition?
method which takes a unique identifier and returns a boolean indicating whether it represents a prohibition.
- Added
PolicyMachine#accessible_objects_for_operations
for finding a map of accessible objects per operation for multiple operations. Only implemented inActiveRecord
and only for directly accessible objects (optiondirect_only
=true
). - Moved database adapter gems
pg
andmysql2
to development dependencies rather than full.
- Added
direct_only
option toPolicyMachineStorageAdapter::ActiveRecord::accessible_objects
to fetch only directly assigned objects.
- Added
pluck
method to PolicyMachine. Implemented for PolicyMachineStorageAdapter::ActiveRecord only.
- Changes reverted.
- Upgrade the Policy Machine to support Rails 6.0.
- Drop support for Ruby versions 2.2.3, 2.3.0, 2.4.1 due to incompatibility with Rails 6.0.
- Update .accessible_ancestor_objects to accept :associations_with_operation in its options argument.
- Optimized ActiveRecord adapter for PolicyMachine
#accessible_ancestor_objects
.
- Added
include_prohibitions
option to PolicyMachine#scoped_privileges
.
- Elevate associations_filtered_by_operation to a public method in the ActiveRecord storage adapter.
- Fix JSON serialization of the
extra_attributes
column.
- Upgrade the Policy Machine to support Rails 5.2.
- Add
is_privilege_with_filters?
andis_privilege_ignoring_prohibitions_with_filters?
methods to Policy Machine. - Add
is_privilege_with_filters?
method to ActiveRecord storage adapter. - Update
scoped_privileges
,accessible_objects
,accessible_ancestor_objects
, andaccessible_operations
to accept a user attribute filter.
- Refactor
accessible_ancestor_objects
andaccessible_objects
.
- Add accessible_ancestor_objects method to ActiveRecord storage adapter.
- Re-expose the 'class_for_type' method to the public interface.
- Improve find_all_of_type_* functionality. This allows for properly passing arrays as arguments as well as making the ignore_case parameter work as intended.
- Loosen 'pg' gem restriction to '< 1.0.0'.
- Downversion 'pg' gem to '~> 0.15.0' to avoid v1.0.0 error with core Rails.
- Add pluck_ancestor_tree method to ActiveRecord storage adapter.
- Add pluck_from method family to the ActiveRecord storage adapter.
- Fix a bug in the active record adapter's accessible_objects method preventing it from returing the correct operation set ids.
- Give precedence to column attribute accessors instead of extra_attributes during store_attributes memoization.
- Update
is_privilege
andaccessible_objects
to use the assignments join table instead of the operations policy elements associations table.
- Add optional filtering to parents and children attribute accessors in the ActiveRecord storage adapter.
- Upgrade RSpec dependency to version 3.5.0
- Add optional filtering to descendants and ancestors methods in the ActiveRecord storage adapter.
- Fix a bug in some of the new import code that prevented operation policy element associations from saving correctly when encountering duplicates, also apply a new partial unique backing index to the policy element associations table
- Add an OperationSet element, and make an operation set a new required field for creating an Association. This will be a required field to populate before consuming the 2.0 version of the policy machine.
- Update the ActiveRecord Adapter to use upserts instead of first or creates for Assignments.
- Standardized the return value of batch_pluck.
- Add batch_pluck method to ActiveRecord storage adapter.
- Fix a bug preventing Prohibitions from accepting extra attributes.
- Fix a bug impacting duplicate new prohibited permissions in bulk persist.
- Improve the bulk_persistence method to include logical links, assignments.
- Remove repetitive warnings about missing columns that trigger in memory filtering.
- Add the ability to link policy elements in different policy machines.
- Add a migration for the
logical_links
table.
– Execute bundle exec rails generate the_policy_machine:add_logical_links_table
and rerun db:migrate
to use these changes.
_~ Many skipped updates to the Changelog. Sorry! ~_
- Fix: Operation sets now silently remove duplicates
- Transactional rollback available in active_record and in_memory
- Can now generate a list of all privileges a user has on an object with
#scoped_privileges
- Initial open source release.