From 6e02960970b569d0be55da5865161654fe6223e2 Mon Sep 17 00:00:00 2001 From: Jay Carman Date: Wed, 16 Aug 2023 16:26:36 -0500 Subject: [PATCH] Fix Configuration>Access Control>Tenants list view The params[:id] is used to identify a particular tenant and allow different access controls for different tenants. The view to list the tenants uses params[:id] = 'xx-tn', which breaks the role_allows? method with a '[RuntimeError] role_allows? no feature was found with identifier: ["rbac_tenant_manage_quotas_tenant_tn"].' message. The base "rbac_tenant_manage_quotas_tenant" feature is sufficient, so adding an extra conditional to skip the whole id parsing allows viewing the list of tenants. --- app/controllers/ops_controller/ops_rbac.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/ops_controller/ops_rbac.rb b/app/controllers/ops_controller/ops_rbac.rb index 0f92f9ad6ce..c889e42c5be 100644 --- a/app/controllers/ops_controller/ops_rbac.rb +++ b/app/controllers/ops_controller/ops_rbac.rb @@ -9,7 +9,7 @@ module OpsController::OpsRbac }.freeze def role_allows?(**options) - if MiqProductFeature.my_root_tenant_identifier?(options[:feature]) && params.key?(:id) + 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