Skip to content

Commit

Permalink
Remove #hide_button_ops method
Browse files Browse the repository at this point in the history
  • Loading branch information
Attila Vecerek committed Feb 23, 2017
1 parent b277753 commit 34ea18f
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions app/helpers/application_helper/toolbar_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -364,21 +364,6 @@ def get_image(img, b_name)
img
end

def hide_button_ops(id)
case x_active_tree
when :settings_tree
return false
when :diagnostics_tree
return false
when :rbac_tree
return false
when :vmdb_tree
return false
else
return true
end
end

# Determine if a button should be hidden
def hide_button?(id)
# need to hide add buttons when on sub-list view screen of a CI.
Expand All @@ -397,19 +382,15 @@ def hide_button?(id)
return false if id == "miq_request_reload" && # Show the request reload button
(@lastaction == "show_list" || @showtype == "miq_provisions")

if @layout == "ops"
res = hide_button_ops(id)
return res
end

return false if id.starts_with?("miq_capacity_") && @sb[:active_tab] == "report"

# don't check for feature RBAC if id is miq_request_approve/deny
unless %w(miq_policy catalogs).include?(@layout)
return true if !role_allows?(:feature => id) && !["miq_request_approve", "miq_request_deny"].include?(id) &&
id !~ /^history_\d*/ &&
!id.starts_with?("dialog_") && !id.starts_with?("miq_task_") &&
!(id == "show_summary" && !@explorer) && id != "summary_reload"
!(id == "show_summary" && !@explorer) && id != "summary_reload" &&
@layout != "ops"
end

# Check buttons with other restriction logic
Expand Down

0 comments on commit 34ea18f

Please sign in to comment.