Skip to content

Commit

Permalink
Merge pull request #20058 from kbrock/rbac_performance_targets
Browse files Browse the repository at this point in the history
Fix a bug when running Rbac on VimPerformanceDaily
  • Loading branch information
Fryguy authored Apr 8, 2020
2 parents 74746cc + 048c861 commit 58ca113
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rbac/filterer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def apply_rbac_directly?(klass)
# the associated application model. See #rbac_class method
#
def apply_rbac_through_association?(klass)
klass != VimPerformanceDaily && (klass < MetricRollup || klass < Metric)
klass != VimPerformanceDaily && klass != VimPerformanceTag && (klass < MetricRollup || klass < Metric)
end

def rbac_base_class(klass)
Expand Down
1 change: 1 addition & 0 deletions spec/lib/rbac/filterer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2622,6 +2622,7 @@ def get_rbac_results_for_and_expect_objects(klass, expected_objects)
it ".apply_rbac_through_association?" do
expect(described_class.new.send(:apply_rbac_through_association?, HostMetric)).to be_truthy
expect(described_class.new.send(:apply_rbac_through_association?, Vm)).not_to be
expect(described_class.new.send(:apply_rbac_through_association?, VimPerformanceTag)).not_to be
end

describe "find_targets_with_direct_rbac" do
Expand Down

0 comments on commit 58ca113

Please sign in to comment.