ManageIQ/manageiq-ui-classic

View on GitHub
app/helpers/application_helper/button/new_host_aggregate.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
class ApplicationHelper::Button::NewHostAggregate < ApplicationHelper::Button::ButtonNewDiscover
  def supports_button_action?
    Rbac::Filterer.filtered(HostAggregate.providers_supporting(:create)).any?
  end

  def disabled?
    @error_message = _("No cloud provider supports creating host aggregates.") unless supports_button_action?
    super || @error_message.present?
  end
end