Skip to content

Commit 6e02960

Browse files
committed
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.
1 parent 08efc93 commit 6e02960

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/ops_controller/ops_rbac.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module OpsController::OpsRbac
99
}.freeze
1010

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

0 commit comments

Comments
 (0)