         return callback \
           new KodingError "It is not allowed to change owner state!"
 
-      JMachine::shareWith.call this, options, callback
-
+      # Permanent option is only valid for paid accounts
+      # if its passed then we need to check payment
+      #
+      if permanent # and @provider is 'koding'
+                   # TODO: we can limit this for koding provider only ~ GG
+
+        Payment = require '../payment'
+        Payment.subscriptions client, {}, (err, subscription)=>
+
+          if err? or not subscription? or subscription.planTitle is 'free'
+            return callback \
+              new KodingError "You don't have a paid subscription!"
+
+          JMachine::shareWith.call this, options, callback
+
+      else
+
+        JMachine::shareWith.call this, options, callback
 
 
   share: secure (client, users, callback) ->

      if target instanceof JUser

        if asUser
        then @addUsers targets, asOwner, callback
        else @removeUsers targets, callback

      else

  # .shareWith can be used like this:
  #
  # JMachineInstance.shareWith {
  #   asUser: yes, asOwner: no, target: ["gokmen", "dicle"], permanent: no}, cb
  # }
  #                        user slugs ->  ^^^^^^ ,  ^^^^^
  #
  # ps. permanent option requires a valid paid subscription
  #

  shareWith$: permit 'populate users',

