     kd.singletons.mainView.activitySidebar.removeMachineNode @mountedMachine
 
 
+  ensureMachineShare: (usernames, callback) ->
+
+    kite = @mountedMachine.getBaseKite()
+
+    kite.klientShared null
+
+      .then (response) =>
+        participants = response.split ','
+        missing = usernames.filter (username) =>
+          participants.indexOf(username) is -1
+
+        @setMachineUser missing, yes, callback
+
+      .catch (err) =>
+        throwError err
+        callback()
+
+
   setMachineSharingStatus: (status, callback) ->
 
     getUsernames = (accounts) ->

        else
          @handleParticipantKicked data.target


  handlePermissionMapChange: (event) ->


      kite   = @mountedMachine.getBaseKite()
      method = if share then 'klientShare' else 'klientUnshare'

      queue = usernames.map (username) =>
        =>
          kite[method] {username}

            .then =>

              @broadcastMessages.push
                type: "#{if share then 'Set' else 'Unset'}MachineUser"
                participants: usernames

              queue.fin()

            .error (err) ->

              queue.fin()

              return  if err.message in [
