Module: G5Authenticatable::Authorization

Extended by:
ActiveSupport::Concern
Defined in:
app/controllers/concerns/g5_authenticatable/authorization.rb

Overview

Authorization helpers and error handling for controllers

Instance Method Summary collapse

Instance Method Details

#user_not_authorizedObject



13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/concerns/g5_authenticatable/authorization.rb', line 13

def user_not_authorized
  respond_to do |format|
    format.json do
      render status: :forbidden, json: { error: 'Access forbidden' }
    end
    format.html do
      render status: :forbidden, file: "#{Rails.root}/public/403"
    end
  end
end