기 때문에 누군가 로그인할 수 있고 다음에 로그인하기 때문에 사용자 아't 확인에 대한 역할까지 한 후에 로그인하지 않는't 의미를 건너뛰기 authorization_check 에 대한 고?
에는 전제하에,나는 상속에서 고 등록 컨트롤러와 이 registrations_controller 배치에서 컨트롤러 디렉토리에 있습니다.
class Users::RegistrationsController < Devise::RegistrationsController
skip_authorization_check
end
을 변경하는 파일 경로:
devise_for :users, :controllers => { :registrations => "registrations" }
나는'm 뭔지
This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.
당신의 도움을 위한 감사합니다.
쉬운 솔루션
check_authorization :unless => :devise_controller?
이 있는 경우를 넣어 check_authorization 에서 모든 컨트롤러 수동으로 일부 지점에서 당신이 잊고 열어 보안에 구멍이다. It's 은 더 나은 명시적으로 허용 컨트롤러는't 필요한 인증에 의해 캉캉.
이것은 분명히에는 캉캉 문서
https://github.com/ryanb/cancan/wiki/Ensure-Authorization
편집
class ApplicationController < ActionController::Base
check_authorization :unless => :do_not_check_authorization?
private
def do_not_check_authorization?
respond_to?(:devise_controller?) or
condition_one? or
condition_two?
end
def condition_one?
...
end
def condition_two?
...
end
end