Index: branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/HiveAdministratorView.Designer.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/HiveAdministratorView.Designer.cs	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/HiveAdministratorView.Designer.cs	(revision 8085)
@@ -81,5 +81,5 @@
       // 
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
       this.Controls.Add(this.tabAdmin);
       this.Name = "HiveAdministrationView";
Index: branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/Recurrence.Designer.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/Recurrence.Designer.cs	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/Recurrence.Designer.cs	(revision 8085)
@@ -235,5 +235,5 @@
       // 
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
       this.ClientSize = new System.Drawing.Size(393, 243);
       this.Controls.Add(this.gbWeekly);
Index: branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.Designer.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.Designer.cs	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.Designer.cs	(revision 8085)
@@ -21,4 +21,5 @@
 
 
+using System;
 namespace HeuristicLab.Clients.Hive.Administrator.Views {
   partial class ResourcesView {
@@ -36,4 +37,9 @@
         components.Dispose();
       }
+      HiveAdminClient.Instance.Refreshing -= new EventHandler(Instance_Refreshing);
+      HiveAdminClient.Instance.Refreshed -= new EventHandler(Instance_Refreshed);
+
+      Access.AccessClient.Instance.Refreshing -= new EventHandler(AccessClient_Refreshing);
+      Access.AccessClient.Instance.Refreshed -= new EventHandler(AccessClient_Refreshed);
       base.Dispose(disposing);
     }
@@ -54,4 +60,5 @@
       this.btnRemoveGroup = new System.Windows.Forms.Button();
       this.btnAddGroup = new System.Windows.Forms.Button();
+      this.btnPermissionsSave = new System.Windows.Forms.Button();
       this.treeSlaveGroup = new System.Windows.Forms.TreeView();
       this.tabSlaveGroup = new System.Windows.Forms.TabControl();
@@ -61,4 +68,6 @@
       this.scheduleView = new HeuristicLab.Clients.Hive.Administrator.Views.ScheduleView();
       this.toolTip = new System.Windows.Forms.ToolTip(this.components);
+      this.tabPermissions = new System.Windows.Forms.TabPage();
+      this.permissionView = new HeuristicLab.Clients.Access.Views.RefreshableLightweightUserView();
       ((System.ComponentModel.ISupportInitialize)(this.splitSlaves)).BeginInit();
       this.splitSlaves.Panel1.SuspendLayout();
@@ -68,4 +77,5 @@
       this.tabDetails.SuspendLayout();
       this.tabSchedule.SuspendLayout();
+      this.tabPermissions.SuspendLayout();
       this.SuspendLayout();
       // 
@@ -79,6 +89,6 @@
       // 
       this.splitSlaves.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.splitSlaves.Location = new System.Drawing.Point(3, 3);
       this.splitSlaves.Name = "splitSlaves";
@@ -156,6 +166,6 @@
       this.treeSlaveGroup.AllowDrop = true;
       this.treeSlaveGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.treeSlaveGroup.ImageIndex = 0;
       this.treeSlaveGroup.ImageList = this.imageListSlaveGroups;
@@ -166,5 +176,5 @@
       this.treeSlaveGroup.TabIndex = 0;
       this.treeSlaveGroup.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.treeSlaveGroup_ItemDrag);
-      this.treeSlaveGroup.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeSlaveGroup_NodeMouseClick);
+      this.treeSlaveGroup.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeSlaveGroup_AfterSelect);
       this.treeSlaveGroup.DragDrop += new System.Windows.Forms.DragEventHandler(this.treeSlaveGroup_DragDrop);
       this.treeSlaveGroup.DragEnter += new System.Windows.Forms.DragEventHandler(this.treeSlaveGroup_DragEnter);
@@ -175,8 +185,9 @@
       // 
       this.tabSlaveGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.tabSlaveGroup.Controls.Add(this.tabDetails);
       this.tabSlaveGroup.Controls.Add(this.tabSchedule);
+      this.tabSlaveGroup.Controls.Add(this.tabPermissions);
       this.tabSlaveGroup.Location = new System.Drawing.Point(3, 3);
       this.tabSlaveGroup.Name = "tabSlaveGroup";
@@ -200,12 +211,12 @@
       // 
       this.slaveView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.slaveView.Caption = "SlaveView";
       this.slaveView.Content = null;
-      this.slaveView.Location = new System.Drawing.Point(7, 7);
+      this.slaveView.Location = new System.Drawing.Point(6, 6);
       this.slaveView.Name = "slaveView";
       this.slaveView.ReadOnly = false;
-      this.slaveView.Size = new System.Drawing.Size(564, 502);
+      this.slaveView.Size = new System.Drawing.Size(565, 503);
       this.slaveView.TabIndex = 0;
       // 
@@ -224,18 +235,55 @@
       // 
       this.scheduleView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.scheduleView.Caption = "ScheduleView";
       this.scheduleView.Content = null;
-      this.scheduleView.Location = new System.Drawing.Point(3, 8);
+      this.scheduleView.Location = new System.Drawing.Point(6, 6);
       this.scheduleView.Name = "scheduleView";
       this.scheduleView.ReadOnly = false;
-      this.scheduleView.Size = new System.Drawing.Size(568, 501);
+      this.scheduleView.Size = new System.Drawing.Size(565, 503);
       this.scheduleView.TabIndex = 0;
       // 
+      // tabPermissions
+      // 
+      this.tabPermissions.Controls.Add(this.btnPermissionsSave);
+      this.tabPermissions.Controls.Add(this.permissionView);
+      this.tabPermissions.Location = new System.Drawing.Point(4, 22);
+      this.tabPermissions.Name = "tabPermissions";
+      this.tabPermissions.Padding = new System.Windows.Forms.Padding(3);
+      this.tabPermissions.Size = new System.Drawing.Size(577, 515);
+      this.tabPermissions.TabIndex = 2;
+      this.tabPermissions.Text = "Permissions";
+      this.tabPermissions.UseVisualStyleBackColor = true;
+      // 
+      // btnPermissionsSave
+      // 
+      this.btnPermissionsSave.Enabled = false;
+      this.btnPermissionsSave.Image = HeuristicLab.Common.Resources.VSImageLibrary.PublishToWeb;
+      this.btnPermissionsSave.Location = new System.Drawing.Point(39, 9);
+      this.btnPermissionsSave.Name = "btnPermissionsSave";
+      this.btnPermissionsSave.Size = new System.Drawing.Size(24, 24);
+      this.btnPermissionsSave.TabIndex = 1;
+      this.toolTip.SetToolTip(this.btnPermissionsSave, "Store slave and group sharing permissions on the server");
+      this.btnPermissionsSave.UseVisualStyleBackColor = true;
+      this.btnPermissionsSave.Click += new System.EventHandler(this.btnPermissionsSave_Click);
+      // 
+      // permissionView
+      // 
+      this.permissionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.permissionView.Caption = "RefreshableLightweightUser View";
+      this.permissionView.Content = null;
+      this.permissionView.FetchSelectedUsers = null;
+      this.permissionView.Location = new System.Drawing.Point(6, 6);
+      this.permissionView.Name = "permissionView";
+      this.permissionView.ReadOnly = false;
+      this.permissionView.Size = new System.Drawing.Size(565, 503);
+      this.permissionView.TabIndex = 0;
+      // 
       // ResourcesView
       // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
       this.Controls.Add(this.splitSlaves);
       this.Name = "ResourcesView";
@@ -249,4 +297,5 @@
       this.tabDetails.ResumeLayout(false);
       this.tabSchedule.ResumeLayout(false);
+      this.tabPermissions.ResumeLayout(false);
       this.ResumeLayout(false);
 
@@ -269,4 +318,7 @@
     private System.Windows.Forms.Button btnRefresh;
     private System.Windows.Forms.ToolTip toolTip;
+    private System.Windows.Forms.TabPage tabPermissions;
+    private Access.Views.RefreshableLightweightUserView permissionView;
+    private System.Windows.Forms.Button btnPermissionsSave;
   }
 }
Index: branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs	(revision 8085)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Collections.Generic;
 using System.Drawing;
 using System.Linq;
@@ -27,4 +28,5 @@
 using System.Threading.Tasks;
 using System.Windows.Forms;
+using HeuristicLab.Clients.Access;
 using HeuristicLab.Clients.Hive.Views;
 using HeuristicLab.Core;
@@ -35,5 +37,5 @@
 namespace HeuristicLab.Clients.Hive.Administrator.Views {
   [View("Resources View")]
-  [Content(typeof(IItemList<Resource>), IsDefaultView = true)]
+  [Content(typeof(IItemList<Resource>), false)]
   public partial class ResourcesView : ItemView, IDisposable {
     public new IItemList<Resource> Content {
@@ -45,6 +47,8 @@
     private const int slaveImageIndex = 0;
     private const int slaveGroupImageIndex = 1;
+    private readonly Color ownedResourceColor = Color.LightGreen;
     private TS.Task progressTask;
     private bool stopProgressTask;
+    private bool currentlyAuthorized;
 
 
@@ -56,9 +60,7 @@
       HiveAdminClient.Instance.Refreshing += new EventHandler(Instance_Refreshing);
       HiveAdminClient.Instance.Refreshed += new EventHandler(Instance_Refreshed);
-    }
-
-    public new void Dispose() {
-      HiveAdminClient.Instance.Refreshing -= new EventHandler(Instance_Refreshing);
-      HiveAdminClient.Instance.Refreshed -= new EventHandler(Instance_Refreshed);
+
+      Access.AccessClient.Instance.Refreshing += new EventHandler(AccessClient_Refreshing);
+      Access.AccessClient.Instance.Refreshed += new EventHandler(AccessClient_Refreshed);
     }
 
@@ -87,8 +89,22 @@
       progressTask = new TS.Task(UpdateProgress);
       progressTask.Start();
+      SetEnabledStateOfControls();
     }
 
     void Instance_Refreshed(object sender, EventArgs e) {
       stopProgressTask = true;
+      SetEnabledStateOfControls();
+    }
+
+    void AccessClient_Refreshing(object sender, EventArgs e) {
+      stopProgressTask = false;
+      progressTask = new TS.Task(UpdateProgress);
+      progressTask.Start();
+      SetEnabledStateOfControls();
+    }
+
+    void AccessClient_Refreshed(object sender, EventArgs e) {
+      stopProgressTask = true;
+      SetEnabledStateOfControls();
     }
 
@@ -110,6 +126,10 @@
       if (Content == null) {
         slaveView.Content = null;
+        scheduleView.Content = null;
+        permissionView.Content = null;
+        permissionView.FetchSelectedUsers = null;
         treeSlaveGroup.Nodes.Clear();
       } else {
+        permissionView.Content = Access.AccessClient.Instance;
         treeSlaveGroup.Nodes.Clear();
 
@@ -134,4 +154,5 @@
               tn.Tag = g;
               tn.Text = g.Name;
+              if (g.OwnerUserId == Access.UserInformation.Instance.User.Id) tn.BackColor = ownedResourceColor;
 
               BuildSlaveGroupTree(g, tn);
@@ -144,4 +165,5 @@
               stn.SelectedImageIndex = stn.ImageIndex;
               stn.Tag = g;
+              if (g.OwnerUserId == Access.UserInformation.Instance.User.Id) stn.BackColor = ownedResourceColor;
               ungrp.Nodes.Add(stn);
             }
@@ -162,4 +184,5 @@
         stn.SelectedImageIndex = stn.ImageIndex;
         stn.Tag = r;
+        if (r.OwnerUserId == Access.UserInformation.Instance.User.Id) stn.BackColor = ownedResourceColor;
         tn.Nodes.Add(stn);
 
@@ -174,25 +197,62 @@
         btnRemoveGroup.Enabled = false;
         btnSave.Enabled = false;
+        btnPermissionsSave.Enabled = false;
+        permissionView.Enabled = false;
+        scheduleView.SetEnabledStateOfSchedule(false);
+        btnPermissionsSave.Enabled = false;
+        permissionView.Enabled = false;
       } else {
         btnAddGroup.Enabled = true;
         btnRemoveGroup.Enabled = true;
         btnSave.Enabled = true;
-      }
-    }
-
-    private void treeSlaveGroup_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) {
-      if (slaveView.Content != null && slaveView.Content is SlaveGroup) {
-        slaveView.Content.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged);
-      }
-
-      slaveView.Content = (Resource)e.Node.Tag;
-      HiveAdminClient.Instance.DowntimeForResourceId = ((Resource)e.Node.Tag).Id;
-
-      if (e.Node.Tag is SlaveGroup) {
-        slaveView.Content.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged);
-      }
-
-      if (tabSlaveGroup.SelectedIndex == 1) {
-        UpdateScheduleAsync();
+        scheduleView.SetEnabledStateOfSchedule(IsAuthorized(slaveView.Content));
+        btnPermissionsSave.Enabled = permissionView.FetchSelectedUsers != null;
+        permissionView.Enabled = permissionView.FetchSelectedUsers != null;
+      }
+    }
+
+    private bool IsAuthorized(Resource resource) {
+      return resource != null
+          && resource.Name != UngroupedGroupName
+          && resource.Id != Guid.Empty
+          && UserInformation.Instance.UserExists
+          && (resource.OwnerUserId == UserInformation.Instance.User.Id || HiveRoles.CheckAdminUserPermissions());
+    }
+
+    private void treeSlaveGroup_AfterSelect(object sender, TreeViewEventArgs e) {
+      if (e.Action != TreeViewAction.Unknown) {
+        Resource selectedResource = ((Resource)e.Node.Tag);
+        currentlyAuthorized = IsAuthorized(selectedResource);
+        if (currentlyAuthorized) {
+          permissionView.FetchSelectedUsers = new Func<List<Guid>>(() => {
+            return HiveServiceLocator.Instance.CallHiveService<List<ResourcePermission>>(service => {
+              return service.GetResourcePermissions(selectedResource.Id);
+            }).Select(x => x.GrantedUserId).ToList();
+          });
+          if (!tabSlaveGroup.TabPages.Contains(tabPermissions)) tabSlaveGroup.TabPages.Add(tabPermissions);
+        } else {
+          permissionView.FetchSelectedUsers = null;
+          btnPermissionsSave.Enabled = false;
+          if (selectedResource.Id == Guid.Empty) {
+            if (!tabSlaveGroup.TabPages.Contains(tabPermissions)) tabSlaveGroup.TabPages.Add(tabPermissions);
+          } else tabSlaveGroup.TabPages.Remove(tabPermissions);
+        }
+
+        if (slaveView.Content != null && slaveView.Content is SlaveGroup) {
+          slaveView.Content.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged);
+        }
+
+        slaveView.Content = selectedResource;
+        HiveAdminClient.Instance.DowntimeForResourceId = selectedResource.Id;
+
+        if (selectedResource is SlaveGroup) {
+          slaveView.Content.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged);
+        }
+
+        if (tabSlaveGroup.SelectedIndex == 1) {
+          UpdateScheduleAsync();
+        } else if (tabSlaveGroup.SelectedIndex == 2) {
+          UpdatePermissionsAsync();
+        }
       }
     }
@@ -217,4 +277,5 @@
       SlaveGroup newGroup = new SlaveGroup();
       newGroup.Name = "New Group";
+      newGroup.OwnerUserId = UserInformation.Instance.User.Id;
       Content.Add(newGroup);
     }
@@ -269,5 +330,5 @@
         if (destNode.TreeView == newNode.TreeView) {
           if (destNode.Text == UngroupedGroupName || (destNode.Parent != null && destNode.Parent.Text == UngroupedGroupName)) {
-            MessageBox.Show(String.Format("You can't drag items to the {0} group.{1}This group only contains slaves which haven't yet been assigned to a real group.",
+            MessageBox.Show(string.Format("You can't drag items to the group \"{0}\".{1}This group only contains slaves which haven't yet been assigned to a real group.",
               UngroupedGroupName, Environment.NewLine), "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Information);
             return;
@@ -285,4 +346,12 @@
 
           if (newNode.Tag is SlaveGroup && CheckParentsEqualsMovedNode(parentNode, newNode)) {
+            return;
+          }
+
+          SlaveGroup parent = (SlaveGroup)parentNode.Tag;
+
+          if (parent.OwnerUserId != null && !IsAuthorized(parent)) {
+            MessageBox.Show(string.Format("You don't have the permissions to drag items to the group \"{0}\".", ((Resource)parentNode.Tag).Name),
+              "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
           }
@@ -330,5 +399,6 @@
     private void treeSlaveGroup_ItemDrag(object sender, ItemDragEventArgs e) {
       TreeNode sourceNode = (TreeNode)e.Item;
-      DoDragDrop(sourceNode, DragDropEffects.All);
+      if (IsAuthorized((Resource)sourceNode.Tag))
+        DoDragDrop(sourceNode, DragDropEffects.All);
     }
 
@@ -403,5 +473,8 @@
     private void UpdateSchedule() {
       HiveAdminClient.Instance.RefreshCalendar();
-      scheduleView.Invoke(new Action(() => scheduleView.Content = HiveAdminClient.Instance.Downtimes));
+      scheduleView.Invoke(new Action(() => {
+        scheduleView.Content = HiveAdminClient.Instance.Downtimes;
+        SetEnabledStateOfControls();
+      }));
     }
 
@@ -412,4 +485,16 @@
     }
 
+    private void UpdatePermissions() {
+      if (permissionView.Content != null && permissionView.FetchSelectedUsers != null)
+        permissionView.Invoke(new Action(() => permissionView.ManualRefresh()));
+    }
+
+    private void UpdatePermissionsAsync() {
+      TS.Task.Factory.StartNew(UpdatePermissions).ContinueWith((t) => {
+        DisplayError(t.Exception);
+      }, TaskContinuationOptions.OnlyOnFaulted);
+    }
+
+
     private void DisplayError(Exception ex) {
       MessageBox.Show(string.Format("An error occured while updating: {0} {1}", Environment.NewLine, ex.Message), "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error);
@@ -419,4 +504,6 @@
       if (tabSlaveGroup.SelectedIndex == 1) {
         UpdateScheduleAsync();
+      } else if (tabSlaveGroup.SelectedIndex == 2) {
+        UpdatePermissionsAsync();
       }
     }
@@ -429,4 +516,13 @@
       UpdateResourcesAsync();
     }
+
+    private void btnPermissionsSave_Click(object sender, EventArgs e) {
+      SetEnabledStateOfControls();
+      HiveServiceLocator.Instance.CallHiveService(service => {
+        service.GrantResourcePermissions(((Resource)treeSlaveGroup.SelectedNode.Tag).Id, permissionView.GetAddedUsers().Select(x => x.Id).ToList());
+        service.RevokeResourcePermissions(((Resource)treeSlaveGroup.SelectedNode.Tag).Id, permissionView.GetDeletedUsers().Select(x => x.Id).ToList());
+      });
+      SetEnabledStateOfControls();
+    }
   }
 }
Index: branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ScheduleView.Designer.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ScheduleView.Designer.cs	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ScheduleView.Designer.cs	(revision 8085)
@@ -71,6 +71,7 @@
       this.dvOnline.ActiveTool = drawTool1;
       this.dvOnline.AmPmDisplay = false;
-      this.dvOnline.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Left)));
+      this.dvOnline.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.dvOnline.AppointmentDuration = Calendar.AppointmentSlotDuration.SixtyMinutes;
       this.dvOnline.AppointmentHeightMode = Calendar.AppHeightDrawMode.TrueHeightAll;
@@ -83,10 +84,10 @@
       this.dvOnline.EnableTimeIndicator = false;
       this.dvOnline.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F);
-      this.dvOnline.Location = new System.Drawing.Point(9, 176);
+      this.dvOnline.Location = new System.Drawing.Point(3, 183);
       this.dvOnline.MinHalfHourApp = false;
       this.dvOnline.Name = "dvOnline";
       this.dvOnline.SelectionEnd = new System.DateTime(((long)(0)));
       this.dvOnline.SelectionStart = new System.DateTime(((long)(0)));
-      this.dvOnline.Size = new System.Drawing.Size(823, 354);
+      this.dvOnline.Size = new System.Drawing.Size(836, 354);
       this.dvOnline.StartDate = new System.DateTime(((long)(0)));
       this.dvOnline.TabIndex = 54;
@@ -123,4 +124,5 @@
       // groupBox1
       // 
+      this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
       this.groupBox1.Controls.Add(this.txttimeTo);
       this.groupBox1.Controls.Add(this.txttimeFrom);
@@ -133,7 +135,7 @@
       this.groupBox1.Controls.Add(this.label1);
       this.groupBox1.Controls.Add(this.btCreate);
-      this.groupBox1.Location = new System.Drawing.Point(373, 4);
+      this.groupBox1.Location = new System.Drawing.Point(375, 3);
       this.groupBox1.Name = "groupBox1";
-      this.groupBox1.Size = new System.Drawing.Size(254, 161);
+      this.groupBox1.Size = new System.Drawing.Size(259, 168);
       this.groupBox1.TabIndex = 56;
       this.groupBox1.TabStop = false;
@@ -217,7 +219,8 @@
       // btnSaveCal
       // 
+      this.btnSaveCal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
       this.btnSaveCal.Image = HeuristicLab.Common.Resources.VSImageLibrary.PublishToWeb;
       this.btnSaveCal.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
-      this.btnSaveCal.Location = new System.Drawing.Point(633, 41);
+      this.btnSaveCal.Location = new System.Drawing.Point(640, 41);
       this.btnSaveCal.Name = "btnSaveCal";
       this.btnSaveCal.Size = new System.Drawing.Size(199, 26);
@@ -230,7 +233,8 @@
       // btnClearCal
       // 
+      this.btnClearCal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
       this.btnClearCal.Image = HeuristicLab.Common.Resources.VSImageLibrary.Document;
       this.btnClearCal.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
-      this.btnClearCal.Location = new System.Drawing.Point(633, 9);
+      this.btnClearCal.Location = new System.Drawing.Point(640, 9);
       this.btnClearCal.Name = "btnClearCal";
       this.btnClearCal.Size = new System.Drawing.Size(199, 26);
@@ -243,6 +247,8 @@
       // mcOnline
       // 
+      this.mcOnline.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.mcOnline.CalendarDimensions = new System.Drawing.Size(2, 1);
-      this.mcOnline.Location = new System.Drawing.Point(4, 9);
+      this.mcOnline.Location = new System.Drawing.Point(3, 9);
       this.mcOnline.Name = "mcOnline";
       this.mcOnline.TabIndex = 55;
@@ -251,6 +257,5 @@
       // ScheduleView
       // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
       this.Controls.Add(this.dvOnline);
       this.Controls.Add(this.groupBox1);
Index: branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ScheduleView.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ScheduleView.cs	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ScheduleView.cs	(revision 8085)
@@ -228,8 +228,14 @@
     protected override void SetEnabledStateOfControls() {
       base.SetEnabledStateOfControls();
-      if (Content == null) {
-        btnSaveCal.Enabled = false;
+    }
+
+    public virtual void SetEnabledStateOfSchedule(bool state) {
+      if (InvokeRequired) {
+        Invoke(new Action(() => SetEnabledStateOfSchedule(state)));
       } else {
-        btnSaveCal.Enabled = true;
+        if (Content == null) state = false;
+        groupBox1.Enabled = state;
+        btnClearCal.Enabled = state;
+        btnSaveCal.Enabled = state;
       }
     }
Index: branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/SlaveView.Designer.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/SlaveView.Designer.cs	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/SlaveView.Designer.cs	(revision 8085)
@@ -65,4 +65,8 @@
       this.label3 = new System.Windows.Forms.Label();
       this.txtHbIntervall = new System.Windows.Forms.TextBox();
+      this.cbxDisposable = new System.Windows.Forms.CheckBox();
+      this.label4 = new System.Windows.Forms.Label();
+      this.cbxPublic = new System.Windows.Forms.CheckBox();
+      this.label5 = new System.Windows.Forms.Label();
       this.SuspendLayout();
       // 
@@ -70,7 +74,7 @@
       // 
       this.txtSlaveState.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.txtSlaveState.Enabled = false;
-      this.txtSlaveState.Location = new System.Drawing.Point(146, 216);
+      this.txtSlaveState.Location = new System.Drawing.Point(146, 242);
       this.txtSlaveState.Name = "txtSlaveState";
       this.txtSlaveState.Size = new System.Drawing.Size(390, 20);
@@ -80,7 +84,7 @@
       // 
       this.txtOS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.txtOS.Enabled = false;
-      this.txtOS.Location = new System.Drawing.Point(146, 190);
+      this.txtOS.Location = new System.Drawing.Point(146, 216);
       this.txtOS.Name = "txtOS";
       this.txtOS.Size = new System.Drawing.Size(390, 20);
@@ -90,5 +94,5 @@
       // 
       this.label15.AutoSize = true;
-      this.label15.Location = new System.Drawing.Point(3, 219);
+      this.label15.Location = new System.Drawing.Point(3, 245);
       this.label15.Name = "label15";
       this.label15.Size = new System.Drawing.Size(35, 13);
@@ -99,5 +103,5 @@
       // 
       this.label14.AutoSize = true;
-      this.label14.Location = new System.Drawing.Point(3, 193);
+      this.label14.Location = new System.Drawing.Point(3, 219);
       this.label14.Name = "label14";
       this.label14.Size = new System.Drawing.Size(93, 13);
@@ -108,7 +112,7 @@
       // 
       this.txtDetailsDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.txtDetailsDescription.Enabled = false;
-      this.txtDetailsDescription.Location = new System.Drawing.Point(146, 86);
+      this.txtDetailsDescription.Location = new System.Drawing.Point(146, 112);
       this.txtDetailsDescription.Name = "txtDetailsDescription";
       this.txtDetailsDescription.Size = new System.Drawing.Size(390, 20);
@@ -118,5 +122,5 @@
       // 
       this.label13.AutoSize = true;
-      this.label13.Location = new System.Drawing.Point(3, 89);
+      this.label13.Location = new System.Drawing.Point(3, 115);
       this.label13.Name = "label13";
       this.label13.Size = new System.Drawing.Size(63, 13);
@@ -127,5 +131,5 @@
       // 
       this.txtName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.txtName.Location = new System.Drawing.Point(146, 8);
       this.txtName.Name = "txtName";
@@ -137,7 +141,7 @@
       // 
       this.txtCPU.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.txtCPU.Enabled = false;
-      this.txtCPU.Location = new System.Drawing.Point(146, 112);
+      this.txtCPU.Location = new System.Drawing.Point(146, 138);
       this.txtCPU.Name = "txtCPU";
       this.txtCPU.Size = new System.Drawing.Size(390, 20);
@@ -147,7 +151,7 @@
       // 
       this.txtMemory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.txtMemory.Enabled = false;
-      this.txtMemory.Location = new System.Drawing.Point(146, 138);
+      this.txtMemory.Location = new System.Drawing.Point(146, 164);
       this.txtMemory.Name = "txtMemory";
       this.txtMemory.Size = new System.Drawing.Size(390, 20);
@@ -157,7 +161,7 @@
       // 
       this.txtLastHeartbeat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.txtLastHeartbeat.Enabled = false;
-      this.txtLastHeartbeat.Location = new System.Drawing.Point(146, 242);
+      this.txtLastHeartbeat.Location = new System.Drawing.Point(146, 268);
       this.txtLastHeartbeat.Name = "txtLastHeartbeat";
       this.txtLastHeartbeat.Size = new System.Drawing.Size(390, 20);
@@ -167,5 +171,5 @@
       // 
       this.label12.AutoSize = true;
-      this.label12.Location = new System.Drawing.Point(3, 245);
+      this.label12.Location = new System.Drawing.Point(3, 271);
       this.label12.Name = "label12";
       this.label12.Size = new System.Drawing.Size(80, 13);
@@ -176,5 +180,5 @@
       // 
       this.label11.AutoSize = true;
-      this.label11.Location = new System.Drawing.Point(3, 141);
+      this.label11.Location = new System.Drawing.Point(3, 167);
       this.label11.Name = "label11";
       this.label11.Size = new System.Drawing.Size(47, 13);
@@ -185,5 +189,5 @@
       // 
       this.label10.AutoSize = true;
-      this.label10.Location = new System.Drawing.Point(3, 115);
+      this.label10.Location = new System.Drawing.Point(3, 141);
       this.label10.Name = "label10";
       this.label10.Size = new System.Drawing.Size(32, 13);
@@ -203,5 +207,5 @@
       // 
       this.label1.AutoSize = true;
-      this.label1.Location = new System.Drawing.Point(3, 167);
+      this.label1.Location = new System.Drawing.Point(3, 193);
       this.label1.Name = "label1";
       this.label1.Size = new System.Drawing.Size(70, 13);
@@ -212,7 +216,7 @@
       // 
       this.txtFreeMemory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.txtFreeMemory.Enabled = false;
-      this.txtFreeMemory.Location = new System.Drawing.Point(146, 164);
+      this.txtFreeMemory.Location = new System.Drawing.Point(146, 190);
       this.txtFreeMemory.Name = "txtFreeMemory";
       this.txtFreeMemory.Size = new System.Drawing.Size(390, 20);
@@ -222,7 +226,7 @@
       // 
       this.txtId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.txtId.Enabled = false;
-      this.txtId.Location = new System.Drawing.Point(146, 60);
+      this.txtId.Location = new System.Drawing.Point(146, 86);
       this.txtId.Name = "txtId";
       this.txtId.Size = new System.Drawing.Size(390, 20);
@@ -232,5 +236,5 @@
       // 
       this.label2.AutoSize = true;
-      this.label2.Location = new System.Drawing.Point(3, 63);
+      this.label2.Location = new System.Drawing.Point(3, 89);
       this.label2.Name = "label2";
       this.label2.Size = new System.Drawing.Size(19, 13);
@@ -250,5 +254,5 @@
       // 
       this.txtHbIntervall.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.txtHbIntervall.Location = new System.Drawing.Point(146, 34);
       this.txtHbIntervall.Name = "txtHbIntervall";
@@ -257,8 +261,52 @@
       this.txtHbIntervall.TextChanged += new System.EventHandler(this.txtHbIntervall_TextChanged);
       // 
+      // cbxDisposable
+      // 
+      this.cbxDisposable.AutoSize = true;
+      this.cbxDisposable.Enabled = false;
+      this.cbxDisposable.Location = new System.Drawing.Point(146, 297);
+      this.cbxDisposable.Name = "cbxDisposable";
+      this.cbxDisposable.Size = new System.Drawing.Size(15, 14);
+      this.cbxDisposable.TabIndex = 34;
+      this.cbxDisposable.UseVisualStyleBackColor = true;
+      this.cbxDisposable.CheckedChanged += new System.EventHandler(this.cbxDisposable_CheckedChanged);
+      // 
+      // label4
+      // 
+      this.label4.AutoSize = true;
+      this.label4.Location = new System.Drawing.Point(3, 297);
+      this.label4.Name = "label4";
+      this.label4.Size = new System.Drawing.Size(62, 13);
+      this.label4.TabIndex = 35;
+      this.label4.Text = "Disposable:";
+      // 
+      // cbxPublic
+      // 
+      this.cbxPublic.AutoSize = true;
+      this.cbxPublic.Enabled = false;
+      this.cbxPublic.Location = new System.Drawing.Point(146, 63);
+      this.cbxPublic.Name = "cbxPublic";
+      this.cbxPublic.Size = new System.Drawing.Size(15, 14);
+      this.cbxPublic.TabIndex = 36;
+      this.cbxPublic.UseVisualStyleBackColor = true;
+      this.cbxPublic.CheckedChanged += new System.EventHandler(this.cbxPublic_CheckedChanged);
+      // 
+      // label5
+      // 
+      this.label5.AutoSize = true;
+      this.label5.Location = new System.Drawing.Point(3, 63);
+      this.label5.Name = "label5";
+      this.label5.Size = new System.Drawing.Size(39, 13);
+      this.label5.TabIndex = 37;
+      this.label5.Text = "Public:";
+      // 
       // SlaveView
       // 
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.label5);
+      this.Controls.Add(this.cbxPublic);
+      this.Controls.Add(this.label4);
+      this.Controls.Add(this.cbxDisposable);
       this.Controls.Add(this.txtHbIntervall);
       this.Controls.Add(this.label3);
@@ -282,5 +330,5 @@
       this.Controls.Add(this.label9);
       this.Name = "SlaveView";
-      this.Size = new System.Drawing.Size(539, 267);
+      this.Size = new System.Drawing.Size(539, 407);
       this.ResumeLayout(false);
       this.PerformLayout();
@@ -310,4 +358,8 @@
     private System.Windows.Forms.Label label3;
     private System.Windows.Forms.TextBox txtHbIntervall;
+    private System.Windows.Forms.CheckBox cbxDisposable;
+    private System.Windows.Forms.Label label4;
+    private System.Windows.Forms.CheckBox cbxPublic;
+    private System.Windows.Forms.Label label5;
   }
 }
Index: branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/SlaveView.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/SlaveView.cs	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Clients.Hive.Administrator/3.3/Views/SlaveView.cs	(revision 8085)
@@ -22,4 +22,5 @@
 using System;
 using System.Windows.Forms;
+using HeuristicLab.Clients.Access;
 using HeuristicLab.Core.Views;
 using HeuristicLab.MainForm;
@@ -62,10 +63,17 @@
         txtId.Clear();
         txtHbIntervall.Clear();
+        cbxDisposable.Checked = false;
+        cbxPublic.Checked = false;
       } else {
         if (Content.GetType() == typeof(Slave)) {
           ShowSlaveUI(true);
           Slave ct = (Slave)Content;
+          bool authorized = UserInformation.Instance.UserExists && (ct.OwnerUserId == UserInformation.Instance.User.Id || HiveRoles.CheckAdminUserPermissions());
           txtName.Text = ct.Name;
           txtHbIntervall.Text = ct.HbInterval.ToString();
+          cbxPublic.Enabled = authorized;
+          cbxPublic.CheckedChanged -= new EventHandler(cbxPublic_CheckedChanged);
+          cbxPublic.Checked = ct.OwnerUserId == null;
+          cbxPublic.CheckedChanged += new EventHandler(cbxPublic_CheckedChanged);
           txtCPU.Text = string.Format("{0} Cores @ {1} Mhz, Arch.: {2}", ct.Cores.ToString(), ct.CpuSpeed.ToString(), ct.CpuArchitecture.ToString());
           txtDetailsDescription.Text = ct.Description;
@@ -76,8 +84,14 @@
           txtFreeMemory.Text = ct.FreeMemory.ToString();
           txtId.Text = ct.Id.ToString();
+          cbxDisposable.Enabled = authorized;
+          cbxDisposable.Checked = ct.IsDisposable.GetValueOrDefault();
         } else if (Content.GetType() == typeof(SlaveGroup)) {
           SlaveGroup ct = (SlaveGroup)Content;
           txtName.Text = ct.Name;
           txtHbIntervall.Text = ct.HbInterval.ToString();
+          cbxPublic.Enabled = ct.Name != "UNGROUPED" && HiveRoles.CheckAdminUserPermissions();
+          cbxPublic.CheckedChanged -= new EventHandler(cbxPublic_CheckedChanged);
+          cbxPublic.Checked = ct.OwnerUserId == null;
+          cbxPublic.CheckedChanged += new EventHandler(cbxPublic_CheckedChanged);
           ShowSlaveUI(false);
         } else {
@@ -88,6 +102,7 @@
 
     private void ShowSlaveUI(bool show) {
+      label1.Visible = show;
       label2.Visible = show;
-      label1.Visible = show;
+      label4.Visible = show;
       label10.Visible = show;
       label11.Visible = show;
@@ -105,4 +120,5 @@
       txtId.Visible = show;
       txtName.Enabled = !show;
+      cbxDisposable.Visible = show;
     }
 
@@ -131,4 +147,16 @@
       }
     }
+
+    private void cbxDisposable_CheckedChanged(object sender, EventArgs e) {
+      if (Content != null) {
+        ((Slave)Content).IsDisposable = cbxDisposable.Checked;
+      }
+    }
+
+    private void cbxPublic_CheckedChanged(object sender, EventArgs e) {
+      if (Content != null) {
+        Content.OwnerUserId = cbxPublic.Checked ? null : new Guid?(UserInformation.Instance.User.Id);
+      }
+    }
   }
 }
