ManageIQ/manageiq-ui-classic

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

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
class ApplicationHelper::Button::VmSnapshotAdd < ApplicationHelper::Button::Basic
  def disabled?
    @error_message = if !role_allows?(:feature => 'vm_snapshot_add')
                       _('Current user lacks permissions to create a new snapshot for this VM')
                     elsif !@record.supports?(:snapshot_create)
                       @record.unsupported_reason(:snapshot_create)
                     end
    @error_message.present?
  end
end