   @create = (options, callback)->
     KD.remote.api.ComputeProvider.create options, callback
 
-  @showProvidersModal = ->
+  @showProvidersModal = requiresLogin
+    message: "You need to login to create a new machine."
+  , ->
     new KDModalView
       title        : 'Add Virtual Machine'
       cssClass     : 'provider-modal'

          title    : "Create"
          style    : "modal-clean-green"
          callback : =>

  @generateAddCredentialFormFor = (provider)->


class ComputeProvider extends KDObject

  requiresLogin = do -> ({ message }, fn) -> ->

    return unless KD.isLoggedIn()
      new KDNotificationView
        title: message

    fn()

  @providers = KD.config.providers

