2
votes

Let's say I want to let some user to read, create and delete(with batch_action) their posts, but I don't want to let them to update posts. Something like this:

   can [:read, :create, :destroy], Post

But when I am running batch action I am seeing that cancan adds some awkward condition like

   [WHERE 1=0]

When I am using :manage instead of solo crud operations(:read, :update, :create, :destroy) it works good.

Any ideas ?

1
Maybe you can look at this docs to add a condition to your batch_action: github.com/activeadmin/activeadmin/blob/master/docs/…anthony

1 Answers

0
votes

You must add batch_action as a possible action the user can do on Post

can %i[read create destroy batch_action], Post