fs/rails-base

View on GitHub
app/controllers/concerns/authorization.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Authorization
  extend ActiveSupport::Concern

  included do
    rescue_from ActionPolicy::Unauthorized, with: :user_not_authorized
  end

  private

  def user_not_authorized
    redirect_to(root_path)
  end
end