<commit_before>require 'controlist/permissions/operation'
require 'controlist/permissions/constrain'
require 'controlist/permissions/simple_constrain'
require 'controlist/permissions/advanced_constrain'
require 'controlist/permissions/ordered_package'

module Controlist
  class Permission

    # properties is hash with property and value pair, operation READ only need keys
    attr_accessor :klass, :operations, :is_allowed, :constrains, :clause, :joins, :properties, :procs_read

    def initialize(klass, operations, is_allowed = true, constrains=nil)
      self.procs_read = []
      self.klass = klass
      unless operations.nil?
        if operations.is_a? Array
          self.operations = operations
        else
          self.operations = [operations]
        end
      end
      self.is_allowed = is_allowed<commit_msg>Default permission oprerations<commit_after>require 'controlist/permissions/operation'
require 'controlist/permissions/constrain'
require 'controlist/permissions/simple_constrain'
require 'controlist/permissions/advanced_constrain'
require 'controlist/permissions/ordered_package'

module Controlist
  class Permission

    # properties is hash with property and value pair, operation READ only need keys
    attr_accessor :klass, :operations, :is_allowed, :constrains, :clause, :joins, :properties, :procs_read

    def initialize(klass, operations=nil, is_allowed = true, constrains=nil)
      self.procs_read = []
      self.klass = klass
      unless operations.nil?
        if operations.is_a? Array
          self.operations = operations
        else
          self.operations = [operations]
        end
      end
      self.is_allowed = is_allowed
{'fraction_non_alphanumeric': 0.07765263781861292, 'fraction_numerical': 0.0, 'mean_word_length': 3.809116809116809, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3368911', 'n_tokens_mistral': 472, 'n_tokens_neox': 462, 'n_words': 119}