Skip to content

Commit

Permalink
API for vm_infras in reconfigure form from manageiq-API(changed the t…
Browse files Browse the repository at this point in the history
…argets according to the condition in rbac filer new way)
  • Loading branch information
jaisejose1123 committed Apr 10, 2024
1 parent 1a3a156 commit 6e6a5ac
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/rbac/filterer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,15 @@ def search(options = {})
end
end

unless targets.count == 1
targets = scope
if targets.count != 1
targets = scope
else
if targets[0].is_a?(Hash)
targets = scope if targets[0][:objectIds].blank?
else
targets = scope if targets.all? { |element| Integer === element }
first_target = targets.first

if first_target.is_a?(Hash) && first_target[:objectIds].blank?
targets = scope
elsif targets.all? { |element| Integer === element }
targets = scope
end
end

Expand Down

0 comments on commit 6e6a5ac

Please sign in to comment.