From 99d5cb835a08393790d19572360e60e5e5b114ff Mon Sep 17 00:00:00 2001 From: Martin Povolny Date: Wed, 19 Jun 2019 14:46:07 +0200 Subject: [PATCH] Custom top-level menu items are not on RBAC tree root level. --- app/presenters/tree_builder_ops_rbac_features.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/presenters/tree_builder_ops_rbac_features.rb b/app/presenters/tree_builder_ops_rbac_features.rb index dbf1904b453..a42b6c67978 100644 --- a/app/presenters/tree_builder_ops_rbac_features.rb +++ b/app/presenters/tree_builder_ops_rbac_features.rb @@ -19,7 +19,9 @@ def initialize(name, sandbox, build, **params) private def x_get_tree_roots(count_only = false, _options) - top_nodes = Menu::Manager.items.select { |section| Vmdb::PermissionStores.instance.can?(section.id) } + top_nodes = Menu::Manager.items.select do |section| + Vmdb::PermissionStores.instance.can?(section.id) && !section.kind_of?(Menu::Item) + end top_nodes += %w[all_vm_rules api_exclusive sui ops_explorer].collect do |additional_feature| MiqProductFeature.obj_features[additional_feature] &&