   shareWith: (client, options, callback) ->
 
     { delegate } = client.connection
-    { target, user, owner, role, mode } = options
+    { target, user, owner, accessLevel } = options
     user ?= yes
 
     # Owners cannot unassign them from a credential

            callback null, []


  setPermissionFor: (target, { user, owner, role, mode }, callback) ->

    Relationship.remove
      targetId : @getId()

        target.fetchOwnAccount (err, account) =>
          if err or not account
            return callback new KodingError 'Failed to fetch account.'
          @setPermissionFor account, { user, owner }, callback

      else if target instanceof JGroup
        @setPermissionFor target, { user, owner, accessLevel }, callback

      else
        callback new KodingError 'Target does not support credentials.'
