-
I am using cancan 1.6.8 in my application
**ApplicationController.rb**
```
rescue_from ActiveRecord::RecordNotFound, :with => :throw_404
def throw_404
redirect_to root_path, :flash => {:error => …
-
According to the docs on Ability Precedence, abilities defined later should take precendence over abilities defined earlier. However, the accessibly_by method, at least for Mongoid, does not behave th…
-
I have a method(transfer_license) that involves updating a multiple objects. How do I setup permission for the this method. does cancan support method level permissions?
-
I've come across a case while using Cancan 2.0 which I'm not sure if it's a bug or the expected behavior - if you could please help clarify that would be a big help.
I have a namespaced controller `D…
-
I have an activeadmin app that I have just installed cancan on. I have a model for orders and admin_user. Before the installation of cancan, this was working. When I create an order with a user that h…
-
I just completed an enhancement request for our application to enable more fine-grained permissions on objects based on relationships defined between two resources. I had written a few unit tests to m…
-
When using cancan's rspec `be_able_to` matcher like `it { should be_able_to(:manage, User) }` the description (with `rspec -fd`) becomes `should be able to :manage and User(id: integer, ...)` (notice …
eLod updated
10 years ago
-
Is it possible in CanCan 2 to define abilities on attributes, and the possible values that can be set.
I suppose the broadest example is the `User.role` ... imagine the role tiers as follows:
```
A…
-
Look, i have
``` rb
can :create, Project { |instance| some_statement }
```
Later i want to add such condition: if user can create some Project, then he can read ProjectTemplate. But i can't do thi…
-
I have CanCan and Devise on my Rails 4.1 app and everything works great except for one thing.
I have defined a role :admin that basically can :manage :all including profiles of other users. After usi…