Skip to content

Commit

Permalink
Make rbac_tenant_manage_quotas feature as self_tenant_feature
Browse files Browse the repository at this point in the history
  • Loading branch information
lpichler committed Jan 4, 2019
1 parent f2ebfd5 commit 004333e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/models/miq_product_feature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class MiqProductFeature < ApplicationRecord
REQUIRED_ATTRIBUTES = [:identifier].freeze
OPTIONAL_ATTRIBUTES = %i(name feature_type description children hidden protected).freeze
ALLOWED_ATTRIBUTES = (REQUIRED_ATTRIBUTES + OPTIONAL_ATTRIBUTES).freeze
TENANT_FEATURE_ROOT_IDENTIFIERS = %w(dialog_new_editor dialog_edit_editor dialog_copy_editor dialog_delete rbac_tenant_manage_quotas).freeze
MY_TENANT_FEATURE_ROOT_IDENTIFIERS = %w(rbac_tenant_manage_quotas).freeze
TENANT_FEATURE_ROOT_IDENTIFIERS = (%w(dialog_new_editor dialog_edit_editor dialog_copy_editor dialog_delete) + MY_TENANT_FEATURE_ROOT_IDENTIFIERS).freeze

def name
value = self[:name]
Expand All @@ -49,6 +50,10 @@ def self.tenant_identifier(identifier, tenant_id)
"#{identifier}_tenant_#{tenant_id}"
end

def self.my_root_tenant_identifier?(identifier)
MY_TENANT_FEATURE_ROOT_IDENTIFIERS.include?(identifier)
end

def self.root_tenant_identifier?(identifier)
TENANT_FEATURE_ROOT_IDENTIFIERS.include?(identifier)
end
Expand Down

0 comments on commit 004333e

Please sign in to comment.