cancancan
cancancan copied to clipboard
The authorization Gem for Ruby on Rails.
### Steps to reproduce https://gist.github.com/chubchenko/883eb5a7c49b194a223be3843774670f ### Expected behavior Does not raise an exception `ArgumentError: Polymorphic associations do not support computing the class` ### Actual behavior Raises an exception: ```sh Error:...
This is just a suggestion but it adding a FAQ in the README can help people who use cancan to quickly resolve some problems that can occur the moment they...
See https://github.com/CanCanCommunity/cancancan/blob/959eee14e132b3f5e22b9e29649327eaf46efb37/lib/cancan/model_adapters/sti_normalizer.rb#L34 The `merge` presumes a hash of conditions but this raises error if the conditions are a relation.
Running dangerous :show permission when the resource name is passed and mismatch the controller name
### Steps to reproduce When creating a custom controller and delegating permissions on another resource, the resource is treated as a parent and defaulting the action to `:show` instead of...
### Steps to reproduce The code below produces this error when assigning the parent to the new resource using the `:through` parameter that points to a method in the controller....
Passing a query to a rule is already supported by `accessible_by` but not when checking on a single resource. This PR fixes that and adds specs for it. Example usage:...
Let's not allow to specify `expect(...).not_to be_able_to(:action_a, :action_b)` for multiple actions. This lead in the past to too many open issues. Here are some: * https://github.com/CanCanCommunity/cancancan/pull/646 * https://github.com/CanCanCommunity/cancancan/pull/602 * https://github.com/CanCanCommunity/cancancan/issues/505...
Provides a scope within the model to find instances of the model accessible by the given ability within the given action/subject permission pair. I.E.: Given the scenario below ```ruby class...
Store the subclasses and only load them if they were not previously stored. This should make things run faster for applications that have a lot of different models with a...