Pundit authorization sitewide

This commit is contained in:
Jesse C. Fisher 2023-12-05 05:27:51 +00:00 committed by TheNeedful-DO
parent 5dfcab4538
commit 1e2d55e02e

View File

@ -1,4 +1,5 @@
class ApplicationController < ActionController::Base
include Pundit::Authorization
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
# protect_from_forgery with: :exception
@ -9,7 +10,6 @@ class ApplicationController < ActionController::Base
before_action :get_global_doodads
if (Rails.env.development? || Rails.env.test?)
include Pundit::Authorization
after_action :verify_authorized, unless: -> { devise_controller? }
# after_action :verify_policy_scoped, only: :index
rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized