Sha256: 3ef7d1c925b8802727ceff9312984d555a4c647d47d89c90ad7cb9f1bf8e04eb
Contents?: true
Size: 966 Bytes
Versions: 24
Compression:
Stored size: 966 Bytes
Contents
# Copyright (c) 2018 Sqreen. All Rights Reserved. # Please refer to our terms for more information: https://www.sqreen.io/terms.html require 'sqreen/rule_callback' require 'sqreen/actions' module Sqreen module Rules # Runs the block_user actions (for hooking Sqreen.{identify,auth_user}) class RunUserActions < CB def initialize(klass, method, auth_keys_idx) super(klass, method) @auth_keys_idx = auth_keys_idx end def post(_retval, _inst, args, _budget = nil) actions = actions_repo.get('block_user', args[@auth_keys_idx]) + actions_repo.get('redirect_user', args[@auth_keys_idx]) actions.each do |action| res = action.run args[@auth_keys_idx] return res unless res.nil? end nil end private # @return [Sqreen::Actions::Repository] def actions_repo Sqreen::Actions::Repository.instance end end end end
Version data entries
24 entries across 24 versions & 1 rubygems