If I have an Admin and SuperAdmin role. How can I limit downloads to the SuperAdmin only.
index download_links: current_user.super_admin? do
column :email
column :query
default_actions
end
Gives the following error for current_user and current_admin_user:
undefined local variable or method `current_admin_user' for #<ActiveAdmin::ResourceDSL:
Anyway to extract this into CanCan user ability? Also even when I hide the links for a certain user, going to URL.csv still downloads the links. Who can I block this?
You need to put the
current_user.super_admin?
in a Proc.