Skip to content

Commit

Permalink
Custom top-level menu items are not on RBAC tree root level.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpovolny committed Jun 19, 2019
1 parent 2f2cb65 commit 99d5cb8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/presenters/tree_builder_ops_rbac_features.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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] &&
Expand Down

0 comments on commit 99d5cb8

Please sign in to comment.