Sha256: 88e456220aa0bebd933a2a16323d76aff84f5af66c9c8e95714eba5a4ed1ed1e
Contents?: true
Size: 769 Bytes
Versions: 4
Compression:
Stored size: 769 Bytes
Contents
module RocketJobMissionControl class ApplicationController < ActionController::Base protect_from_forgery with: :exception around_action :with_time_zone private def with_time_zone(&block) if time_zone = session['time_zone'] || 'UTC' Time.use_zone(time_zone, &block) end end def current_policy @current_policy ||= begin @args = if Config.authorization_callback instance_exec(&Config.authorization_callback) else {roles: %i[admin]} end AccessPolicy.new(Authorization.new(@args)) end end def login @login ||= begin args = instance_exec(&Config.authorization_callback) args[:login] end end end end
Version data entries
4 entries across 4 versions & 1 rubygems