Sha256: 3920c0adb2a4d1be82089ccbc740a1695504360383be9d0968596973b6d04739
Contents?: true
Size: 776 Bytes
Versions: 7
Compression:
Stored size: 776 Bytes
Contents
module Trax module Controller module Authorize extend ::ActiveSupport::Concern include ::Trax::Controller.config.authorization_adapter STANDARD_ACTIONS = [ :index, :search, :show, :destroy, :update, :create, :new ] module ClassMethods def actions_to_authorize(*_actions, all:false, except:false, only:false) _actions += (all || except) ? STANDARD_ACTIONS.dup : [] _actions += only if only _actions.reject!{ |_action| except.include?(_action) } if except _actions.each do |action| action_module = ::Trax::Controller.config.authorization_adapter.authorization_action_for(action) include action_module if action_module end end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems