Skip to content

Fixed: Pundit's AuthorizationNotPerformedError#2683

Merged
mshibuya merged 2 commits into
railsadminteam:masterfrom
minifast:master
Aug 5, 2016
Merged

Fixed: Pundit's AuthorizationNotPerformedError#2683
mshibuya merged 2 commits into
railsadminteam:masterfrom
minifast:master

Conversation

@ohrite
Copy link
Copy Markdown
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
Copy Markdown
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.

2 participants