Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Pundit's AuthorizationNotPerformedError #2683

Merged
merged 2 commits into from
Aug 5, 2016

Conversation

ohrite
Copy link
Contributor

@ohrite ohrite commented Aug 4, 2016

After setting up Pundit on a new application, Pundit's README says that I can ensure that every request is authorized:

class ApplicationController < ActionController::Base
  include Pundit
  after_action :verify_authorized
  ...
end

However, as @Samy-Amar has identified in #2642, Pundit checks an instance variable (@_pundit_policy_authorized) as part of this process, and RailsAdmin's Pundit adapter does not set @_pundit_policy_authorized.

This PR sets @_pundit_policy_authorized, and uses some of the existing Pundit testing infrastructure to introduce a RailsAdmin::MainController-level spec for Pundit authorization.

@mshibuya mshibuya merged commit df3b30c into railsadminteam:master Aug 5, 2016
@mshibuya
Copy link
Member

mshibuya commented Aug 5, 2016

Excellent, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants