ActiveAdmin - using the current_admin_user to filter available actions
===

I have an active admin resource like this:


    ActiveAdmin.register Snippet do
      
      menu :label => "Text Snippets"
    
      config.clear_sidebar_sections!
    
      index download_links: false do
        column :key if current_admin_user.developer?
        column :description
        column :contents
        default_actions
      end
    
      form do |f|
        f.inputs do
          f.input :description
          f.input :contents
        end
        f.buttons
      end
    
    end

Notice in the `index` block, I'm only adding the `key` column if the current admin user is a developer. I want to apply this kind of filtering to the available actions.

I tried added this at the top of the resource definition:

    actions current_admin_user.developer ? :all : :index, :edit

But I get a `NameError` on `current_admin_user`. For some reason, outside of the configuration blocks, the active admin `current_admin_user` helper doesn't exist.

So, how could I go about filtering actions based on the current user's priviliges?