1
votes

I am using acitve admin with cancan in my projects. Cancan works fine in project except in admin/users section.

I am not able to do operations like show, destroy on users other than current_user.

Cancan is working fine with other resources of activeadmin but whatever operations i do in admin/user are applied on current_user.

I have given permission to admin as,

if user.has_role? :admin
      can :manage, :all
end

and implemented activeadmin with existing User model.

Do you have any idea??

Thanks in advance.

1

1 Answers

0
votes

After searching alot got solution for it. :) :)

i have added on new method in admin/users controller as,

def resource
  User.where(id: params[:id]).first!
end

now its woking fine.. :)