             if isMachineOwner user, machine
             then successFn()
             else failureFn()
+
+          ->
+
+            successFn = makeSuccessFn addSharedFn
+
+            if isMachineShared user, machine
+            then successFn()
+            else failureFn()
         ]
 
         dash filterQueue, -> workspaceQueue.fin()


  @fetchEnvironment$ = secure (client, callback) ->

    data = own: []

    client.connection.delegate.fetchUser (err, user) ->


  isMachineShared = (user, machine) ->

    for u in machine.users
      if (u.id.equals user.getId()) and u.permanent
        return yes

    return no
