   @share()
 
   @set
+
+    indexes        :
+      originId     : 'sparse'
+      slug         : 'sparse'
+
     schema         :
       name         : String
       slug         : String
       machineUId   : String
       machineLabel : String
       rootPath     : String
-      owner        : String
+      originId     : ObjectId
       layout       : Object
 
     sharedMethods  :

      return callback null, workspace

  @fetch = secure (client, query = {}, callback) ->
    query.owner = client.connection.delegate._id
    JWorkspace.some query, {}, callback


  @deleteById = secure (client, id, callback)->

    selector =
      owner  : client.connection.delegate._id
      _id    : ObjectId id

    JWorkspace.one selector, (err, ws)->
      return callback err  if err?

  @deleteByUid = secure (client, uid, callback)->

    selector     =
      originId   : client.connection.delegate._id
      machineUId : uid

    JWorkspace.remove selector, (err)->
