config/initializers/active_admin.rb
에서 다시 구성해야 할 몇 가지 항목이 있습니다.
당신은 인증 방법을 정의 할 필요가 있습니다
# config/initializers/active_admin.rb
# == Current User
#
# Active Admin will associate actions with the current
# user performing them.
#
# This setting changes the method which Active Admin calls
# (within the application controller) to return the currently logged in user.
config.current_user_method = :current_user
# app/controllers/application_controller.rb
def current_user
# returns the current logged in user. Devise provides this automatically. You will need to replace that functionality.
end
는 위의 영향을 미치는 활성 관리자 초기화에 두 가지이다 : 당신은 또한 current_user
방법을 설정해야 할 수도 있습니다
# config/initializers/active_admin.rb
# == User Authentication
#
# Active Admin will automatically call an authentication
# method in a before filter of all controller actions to
# ensure that there is a currently logged in admin user.
#
# This setting changes the method which Active Admin calls
# within the application controller.
config.authentication_method = :authenticate_active_admin_user!
# app/controllers/application_controller.rb
def authenticat_active_admin_user!
# Something that returns true if the current user has access to active admin
end
을 로그인 및 인증. 나는 전체를 살펴보고 사용자 인증 및 권한 부여와 관련된 다른 모든 구성을 살펴볼 것을 권한다. 이니셜 라이저는 주석으로 문서화되어 있으며 Active Admin homepage에 많은 설명서가 있습니다. 활성 관리자가 인증 및 권한 부여에 사용하는 다른 방법 중 일부를 대체해야 할 수도 있습니다.
마지막으로 CanCanCan Ability
클래스가 현재 사용자에게 액세스 할 수 있는지 확인하십시오. 컨트롤러가 올바른 사용자를 전달하지 않으면 액세스가 차단됩니다.
이것은 광범위한 질문이며 광범위한 대답을 게시했습니다. 정확한 오류가 무엇인지 구체적으로 밝히면보다 정확한 도움을 드릴 수 있습니다. –