<commit_before>module Rbac
  class Filterer
    # This list is used to detemine whether RBAC, based on assigned tags, should be applied for a class in a search that is based on the class.
    # Classes should be added to this list ONLY after:
    # 1. It has been added to the MiqExpression::BASE_TABLES list
    # 2. Tagging has been enabled in the UI
    # 3. Class contains acts_as_miq_taggable
    CLASSES_THAT_PARTICIPATE_IN_RBAC = %w(
      AvailabilityZone
      CloudNetwork
      CloudSubnet
      CloudTenant
      CloudVolume
      ConfigurationProfile
      ConfiguredSystem
      ConfigurationScriptBase
      Container
      ContainerBuild
      ContainerGroup
      ContainerImage
      ContainerImageRegistry
      ContainerNode
      ContainerProject
      ContainerReplicator
      ContainerRoute
      ContainerService
      ContainerTemplate
      EmsCluster
      EmsFolder
      ExtManagementSystem
      Flavor
      FloatingIp
      Host
      LoadBalancer
      MiqCimInstance
      NetworkPort
      NetworkRouter
      OrchestrationTemplate
      OrchestrationStack
      ResourcePool
      SecurityGroup
      Service
      ServiceTemplate
      Storage
      VmOrTemplate
    )

    TAGGABLE_FILTER_CLASSES = CLASSES_THAT_PARTICIPATE_IN_RBAC - %w(EmsFolder)

    BELONGSTO_FILTER_CLASSES = %w(
      VmOrTemplate
      Host
      ExtManagementSystem
      EmsFolder
      EmsCluster
      ResourcePool
      Storage
    )

    # key: MiqUserRole#name - user's role
    # value:
    #   array - disallowed roles for the user's role
    DISALLOWED_ROLES_FOR_USER_ROLE = {
      'EvmRole-tenant_administrator' => %w(EvmRole-super_administrator)
    }.freeze

    # key: descendant::klass
    # value:
    #   if it is a symbol/method_name:<commit_msg>Remove admin-role for tenant-administator<commit_after>module Rbac
  class Filterer
    # This list is used to detemine whether RBAC, based on assigned tags, should be applied for a class in a search that is based on the class.
    # Classes should be added to this list ONLY after:
    # 1. It has been added to the MiqExpression::BASE_TABLES list
    # 2. Tagging has been enabled in the UI
    # 3. Class contains acts_as_miq_taggable
    CLASSES_THAT_PARTICIPATE_IN_RBAC = %w(
      AvailabilityZone
      CloudNetwork
      CloudSubnet
      CloudTenant
      CloudVolume
      ConfigurationProfile
      ConfiguredSystem
      ConfigurationScriptBase
      Container
      ContainerBuild
      ContainerGroup
      ContainerImage
      ContainerImageRegistry
      ContainerNode
      ContainerProject
      ContainerReplicator
      ContainerRoute
      ContainerService
      ContainerTemplate
      EmsCluster
      EmsFolder
      ExtManagementSystem
      Flavor
      FloatingIp
      Host
      LoadBalancer
      MiqCimInstance
      NetworkPort
      NetworkRouter
      OrchestrationTemplate
      OrchestrationStack
      ResourcePool
      SecurityGroup
      Service
      ServiceTemplate
      Storage
      VmOrTemplate
    )

    TAGGABLE_FILTER_CLASSES = CLASSES_THAT_PARTICIPATE_IN_RBAC - %w(EmsFolder)

    BELONGSTO_FILTER_CLASSES = %w(
      VmOrTemplate
      Host
      ExtManagementSystem
      EmsFolder
      EmsCluster
      ResourcePool
      Storage
    )

    # key: MiqUserRole#name - user's role
    # value:
    #   array - disallowed roles for the user's role
    DISALLOWED_ROLES_FOR_USER_ROLE = {
      'EvmRole-tenant_administrator' => %w(EvmRole-super_administrator EvmRole-administrator)
    }.freeze

    # key: descendant::klass
    # value:
    #   if it is a symbol/method_name:
{'fraction_non_alphanumeric': 0.035238623751387345, 'fraction_numerical': 0.001664816870144284, 'mean_word_length': 2.439885496183206, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4471349', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1022, 'n_words': 275}