Sha256: cf838bd5da90682adc979c7c92faca7395d4bd87782a1746692b271cdf679e89
Contents?: true
Size: 498 Bytes
Versions: 15
Compression:
Stored size: 498 Bytes
Contents
module G5Authenticatable module Authorization extend ActiveSupport::Concern included do include Pundit rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized end 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 end end
Version data entries
15 entries across 15 versions & 1 rubygems