Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions app/controllers/ops_controller/ops_rbac.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ module OpsController::OpsRbac
}.freeze

def role_allows?(**options)
if MiqProductFeature.my_root_tenant_identifier?(options[:feature]) && params.key?(:id) && params[:id] != 'xx-tn'
if params[:id].to_s.include?('tn')
_, id, _ = TreeBuilder.extract_node_model_and_id(params[:id].to_s)
else
id = params[:id].to_s
end

if MiqProductFeature.my_root_tenant_identifier?(options[:feature]) && self.x_node.to_s.start_with?("tn-")
_, id, _ = TreeBuilder.extract_node_model_and_id(self.x_node.to_s)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonus whitespace

Suggested change
_, id, _ = TreeBuilder.extract_node_model_and_id(self.x_node.to_s)
_, id, _ = TreeBuilder.extract_node_model_and_id(self.x_node.to_s)

options[:feature] = MiqProductFeature.tenant_identifier(options[:feature], id)
end

Expand Down
Loading