 
     success: (client, options, callback)->
 
-      {target, owner, user} = options
+      {target, user, owner} = options
+      user ?= yes
 
       setPermissionFor = (target, callback)=>
 
-        method = (x)-> if x then 'assureCredential' else 'removeCredential'
-
-        daisy queue = [
-          =>
-            if user?
-              target[method(user)]  this, as: 'user', queue.next
-            else
-              queue.next()
-        ,
-          =>
-            if owner?
-              target[method(owner)] this, as: 'owner', queue.next
-            else
-              queue.next()
-        ,
-          -> callback null
-        ]
+        Relationship.remove {
+          targetId : @getId()
+          sourceId : target.getId()
+        }, (err)=>
+
+          if user
+            as = if owner then 'owner' else 'user'
+            target.addCredential this, { as }, (err)-> callback err
+          else
+            callback err
 
       JName.fetchModels target, (err, result)=>
 

          return callback new KodingError "Target not found."

        { models } = result
        target = models[0]

        if target instanceof JUser
          target.fetchOwnAccount (err, account)=>

      options ?= { limit : 10 }

      {delegate} = client.connection
      delegate.fetchCredentials {},
        targetOptions : {
          selector, options
        }, callback

  fetchUsers: permit

    advanced: [
      { permission: 'update credential', validateWith: Validators.own }
    ]

    success: (client, callback)->

      Relationship.someData targetId : @getId(), {
        as:1, sourceId:1, sourceName:1
      }, (err, cursor)->

        return callback err  if err?

        cursor.toArray (err, arr)->
          return callback err  if err?

          if arr.length > 0
            callback null, ({
              constructorName : u.sourceName
              _id : u.sourceId
              as  : u.as
            } for u in arr)
          else
            callback null, []

  # .share can be used like this:
  #
  # JCredentialInstance.share { user: yes, owner: no, target: "gokmen"}, cb
  #                                      group or user slug -> ^^^^^^

  shareWith: permit

    advanced: [
      { permission: 'update credential', validateWith: Validators.own }
