 
       if target instanceof JUser
 
-        if user
-        then @addUsers targets, owner, callback
+        if asUser
+        then @addUsers targets, asOwner, callback
         else @removeUsers targets, callback
 
       else

  # .shareWith can be used like this:
  #
  # JMachineInstance.shareWith {
  #   user: yes, owner: no, target: ["gokmen", "dicle"]}, cb
  # }
  #                    user slugs ->  ^^^^^^ ,  ^^^^^

  shareWith$: permit 'populate users',




  share: secure (client, users, callback)->
    options = target: users, asUser: yes
    JMachine::shareWith$.call this, client, options, callback

  unshare: secure (client, users, callback)->
    options = target: users, asUser: no
    JMachine::shareWith$.call this, client, options, callback

  setAsOwner: secure (client, users, callback)->
    options = target: users, asUser: yes, asOwner: yes
    JMachine::shareWith$.call this, client, options, callback

  unsetAsOwner: secure (client, users, callback)->
    options = target: users, asUser: yes, asOwner: no
    JMachine::shareWith$.call this, client, options, callback
