ruby-on-rails 活动管理员:如何限制生产中的活动管理路由

wyyhbhjk  于 2023-01-06  发布在  Ruby
关注(0)|答案(1)|浏览(107)

我开发了一个正常的(后)像铁路应用程序,具有张贴图片的文章功能,然后我选择了主动管理在规范后(管理员用户),所以应用程序没有任何其他用户,除了管理员,将规范后在后端,我如何限制这些管理员路线页一样,如果一个正常的网络访问者试图访问它不会访问的路线?

new_admin_user_session GET        /admin/login(.:format)                                                                            active_admin/devise/sessions#new
                  admin_user_session POST       /admin/login(.:format)                                                                            active_admin/devise/sessions#create
          destroy_admin_user_session DELETE|GET /admin/logout(.:format)                                                                           active_admin/devise/sessions#destroy
             new_admin_user_password GET        /admin/password/new(.:format)                                                                     active_admin/devise/passwords#new
            edit_admin_user_password GET        /admin/password/edit(.:format)                                                                    active_admin/devise/passwords#edit
                 admin_user_password PATCH      /admin/password(.:format)                                                                         active_admin/devise/passwords#update
                                     PUT        /admin/password(.:format)                                                                         active_admin/devise/passwords#update
                                     POST       /admin/password(.:format)                                                                         active_admin/devise/passwords#create
                          admin_root GET        /admin(.:format)                                                                                  admin/dashboard#index
      batch_action_admin_admin_users POST       /admin/admin_users/batch_action(.:format)                                                         admin/admin_users#batch_action
                   admin_admin_users GET        /admin/admin_users(.:format)                                                                      admin/admin_users#index
                                     POST       /admin/admin_users(.:format)                                                                      admin/admin_users#create
                new_admin_admin_user GET        /admin/admin_users/new(.:format)                                                                  admin/admin_users#new
               edit_admin_admin_user GET        /admin/admin_users/:id/edit(.:format)                                                             admin/admin_users#edit
                    admin_admin_user GET        /admin/admin_users/:id(.:format)                                                                  admin/admin_users#show
                                     PATCH      /admin/admin_users/:id(.:format)                                                                  admin/admin_users#update
                                     PUT        /admin/admin_users/:id(.:format)                                                                  admin/admin_users#update
                                     DELETE     /admin/admin_users/:id(.:format)                                                                  admin/admin_users#destroy
         batch_action_admin_articles POST       /admin/articles/batch_action(.:format)                                                            admin/articles#batch_action
                      admin_articles GET        /admin/articles(.:format)                                                                         admin/articles#index
                                     POST       /admin/articles(.:format)                                                                         admin/articles#create
                   new_admin_article GET        /admin/articles/new(.:format)                                                                     admin/articles#new
                  edit_admin_article GET        /admin/articles/:id/edit(.:format)                                                                admin/articles#edit
                       admin_article GET        /admin/articles/:id(.:format)                                                                     admin/articles#show
                                     PATCH      /admin/articles/:id(.:format)                                                                     admin/articles#update
                                     PUT        /admin/articles/:id(.:format)                                                                     admin/articles#update
                                     DELETE     /admin/articles/:id(.:format)                                                                     admin/articles#destroy
                     admin_dashboard GET        /admin/dashboard(.:format)                                                                        admin/dashboard#index
                      admin_comments GET        /admin/comments(.:format)                                                                         admin/comments#index
                                     POST       /admin/comments(.:format)                                                                         admin/comments#create
                       admin_c
k0pti3hp

k0pti3hp1#

我所看到的唯一方法是在AA中集成一个授权系统,以下是链接:
https://activeadmin.info/13-authorization-adapter.html#managing-access-to-pages

相关问题