0

因此,我在活动管理员中有一个 collection_action, PandaStream api使用它在处理视频时发回通知:

  collection_action :notify, :method => :post do
    # some irrelevant to the question code
  end

rake 路线返回:

notify_admin_videos POST       /admin/videos/notify(.:format)            admin/videos#notify

问题是当我从 pandastream 收到通知时,我得到:

Completed 401 Unauthorized in 0ms

这是意料之中的,因为panda api在我的管理面板中没有经过身份验证。所以问题是,有没有办法在 custom_active 管理操作中跳过身份验证?

请帮我解决这个问题!

谢谢!

4

1 回答 1

2

Certain methods are delegated from the admin register to the controller, as shown here: https://github.com/gregbell/active_admin/blob/4f445b51c22b12af2cdde57fe2ce9835c32ef88e/lib/active_admin/resource_dsl.rb#L156

So you should be able to do something like below:

ActiveAdmin.register Video do
  skip_before_action :authenticate_admin_user!, only: :notify
end
于 2014-06-10T22:45:12.873 回答