<commit_before>require 'api-acl'
require_relative 'rules_example'

module ACL
  module Validators

    def self.global
      return true
    end

    def self.arbitrary_validator
      return true
    end
  end
end

ACL.configure do |config|
  config.force_access_control = true
  config.global_validators = ['global']
end

MyRule.new #Use defined validators

access_level = ACL::Control.put({:consumer => ''}).put({:user => ''}).check_level('test','POST')
p access_level<commit_msg>Update example<commit_after>require 'api-acl'
require_relative 'rules_example'

module ACL
  module Validators

    def self.global
      return true
    end

    def self.arbitrary_validator
      return true
    end
  end
end

ACL.configure do |config|
  config.force_access_control = true
  config.global_validators = ['global']
  config.api_acl_mode = ACL::Configuration::STRATEGY_DESCENDING #this is the default value
end

MyRule.new #Use defined validators

access_level = ACL::Control.put({:consumer => ''}).put({:user => ''}).check_level('test','POST')
p access_level
{'fraction_non_alphanumeric': 0.10869565217391304, 'fraction_numerical': 0.0, 'mean_word_length': 4.268656716417911, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4118567', 'n_tokens_mistral': 341, 'n_tokens_neox': 332, 'n_words': 83}