2017-04-11 05:27:03 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Admin
|
|
|
|
class BaseController < ApplicationController
|
2017-11-12 06:23:33 +11:00
|
|
|
include Authorization
|
2017-11-24 12:05:53 +11:00
|
|
|
include AccountableConcern
|
2017-11-12 06:23:33 +11:00
|
|
|
|
2018-10-25 09:10:01 +11:00
|
|
|
layout 'admin'
|
|
|
|
|
2023-04-20 00:07:29 +10:00
|
|
|
before_action :set_cache_headers
|
|
|
|
|
2022-07-05 10:41:40 +10:00
|
|
|
after_action :verify_authorized
|
2017-04-11 05:27:03 +10:00
|
|
|
|
2018-10-25 09:10:01 +11:00
|
|
|
private
|
|
|
|
|
2023-04-20 00:07:29 +10:00
|
|
|
def set_cache_headers
|
|
|
|
response.cache_control.replace(private: true, no_store: true)
|
|
|
|
end
|
|
|
|
|
2018-12-17 21:40:51 +11:00
|
|
|
def set_user
|
|
|
|
@user = Account.find(params[:account_id]).user || raise(ActiveRecord::RecordNotFound)
|
|
|
|
end
|
2017-04-11 05:27:03 +10:00
|
|
|
end
|
|
|
|
end
|