- Timestamp:
- 06/04/12 14:48:55 (13 years ago)
- Location:
- branches/HiveResourcePermissionManagement (trunk integration)
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveResourcePermissionManagement (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/HeuristicLab.Clients.Hive.Administrator-3.3.csproj
r7257 r7951 80 80 <Private>False</Private> 81 81 </Reference> 82 <Reference Include="HeuristicLab.Clients.Access-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 83 <HintPath>..\..\bin\HeuristicLab.Clients.Access-3.3.dll</HintPath> 84 </Reference> 85 <Reference Include="HeuristicLab.Clients.Access.Administration-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 86 <HintPath>..\..\bin\HeuristicLab.Clients.Access.Administration-3.3.dll</HintPath> 87 </Reference> 88 <Reference Include="HeuristicLab.Clients.Access.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 89 <HintPath>..\..\bin\HeuristicLab.Clients.Access.Views-3.3.dll</HintPath> 90 </Reference> 82 91 <Reference Include="HeuristicLab.DayView-1.0, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 83 92 <HintPath>..\..\bin\HeuristicLab.DayView-1.0.dll</HintPath> … … 97 106 </ItemGroup> 98 107 <ItemGroup> 108 <Compile Include="HiveRoles.cs" /> 99 109 <Compile Include="Views\HiveAdministratorView.cs"> 100 110 <SubType>UserControl</SubType> -
branches/HiveResourcePermissionManagement (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.Designer.cs
r7259 r7951 54 54 this.btnRemoveGroup = new System.Windows.Forms.Button(); 55 55 this.btnAddGroup = new System.Windows.Forms.Button(); 56 this.btnPermissionsSave = new System.Windows.Forms.Button(); 56 57 this.treeSlaveGroup = new System.Windows.Forms.TreeView(); 57 58 this.tabSlaveGroup = new System.Windows.Forms.TabControl(); … … 61 62 this.scheduleView = new HeuristicLab.Clients.Hive.Administrator.Views.ScheduleView(); 62 63 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 64 this.tabPermissions = new System.Windows.Forms.TabPage(); 65 this.permissionView = new HeuristicLab.Clients.Access.Views.RefreshableLightweightUserView(); 63 66 ((System.ComponentModel.ISupportInitialize)(this.splitSlaves)).BeginInit(); 64 67 this.splitSlaves.Panel1.SuspendLayout(); … … 68 71 this.tabDetails.SuspendLayout(); 69 72 this.tabSchedule.SuspendLayout(); 73 this.tabPermissions.SuspendLayout(); 70 74 this.SuspendLayout(); 71 75 // … … 75 79 this.imageListSlaveGroups.ImageSize = new System.Drawing.Size(16, 16); 76 80 this.imageListSlaveGroups.TransparentColor = System.Drawing.Color.Transparent; 77 //78 // splitSlaves79 //80 this.splitSlaves.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)81 | System.Windows.Forms.AnchorStyles.Left)82 | System.Windows.Forms.AnchorStyles.Right)));83 this.splitSlaves.Location = new System.Drawing.Point(3, 3);84 this.splitSlaves.Name = "splitSlaves";85 //86 // splitSlaves.Panel187 //88 this.splitSlaves.Panel1.Controls.Add(this.btnRefresh);89 this.splitSlaves.Panel1.Controls.Add(this.progressBar);90 this.splitSlaves.Panel1.Controls.Add(this.btnSave);91 this.splitSlaves.Panel1.Controls.Add(this.btnRemoveGroup);92 this.splitSlaves.Panel1.Controls.Add(this.btnAddGroup);93 this.splitSlaves.Panel1.Controls.Add(this.treeSlaveGroup);94 //95 // splitSlaves.Panel296 //97 this.splitSlaves.Panel2.Controls.Add(this.tabSlaveGroup);98 this.splitSlaves.Size = new System.Drawing.Size(847, 547);99 this.splitSlaves.SplitterDistance = 249;100 this.splitSlaves.TabIndex = 3;101 81 // 102 82 // btnRefresh … … 111 91 this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click); 112 92 // 113 // progressBar114 //115 this.progressBar.Location = new System.Drawing.Point(123, 4);116 this.progressBar.Name = "progressBar";117 this.progressBar.Size = new System.Drawing.Size(123, 23);118 this.progressBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous;119 this.progressBar.TabIndex = 7;120 //121 93 // btnSave 122 94 // … … 152 124 this.btnAddGroup.Click += new System.EventHandler(this.btnAddGroup_Click); 153 125 // 126 // btnPermissionsSave 127 // 128 this.btnPermissionsSave.Enabled = false; 129 this.btnPermissionsSave.Image = HeuristicLab.Common.Resources.VSImageLibrary.PublishToWeb; 130 this.btnPermissionsSave.Location = new System.Drawing.Point(36, 6); 131 this.btnPermissionsSave.Name = "btnPermissionsSave"; 132 this.btnPermissionsSave.Size = new System.Drawing.Size(24, 24); 133 this.btnPermissionsSave.TabIndex = 1; 134 this.toolTip.SetToolTip(this.btnPermissionsSave, "Store slave and group sharing permissions on the server"); 135 this.btnPermissionsSave.UseVisualStyleBackColor = true; 136 this.btnPermissionsSave.Click += new System.EventHandler(this.btnPermissionsSave_Click); 137 // 138 // splitSlaves 139 // 140 this.splitSlaves.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 141 | System.Windows.Forms.AnchorStyles.Left) 142 | System.Windows.Forms.AnchorStyles.Right))); 143 this.splitSlaves.Location = new System.Drawing.Point(3, 3); 144 this.splitSlaves.Name = "splitSlaves"; 145 // 146 // splitSlaves.Panel1 147 // 148 this.splitSlaves.Panel1.Controls.Add(this.btnRefresh); 149 this.splitSlaves.Panel1.Controls.Add(this.progressBar); 150 this.splitSlaves.Panel1.Controls.Add(this.btnSave); 151 this.splitSlaves.Panel1.Controls.Add(this.btnRemoveGroup); 152 this.splitSlaves.Panel1.Controls.Add(this.btnAddGroup); 153 this.splitSlaves.Panel1.Controls.Add(this.treeSlaveGroup); 154 // 155 // splitSlaves.Panel2 156 // 157 this.splitSlaves.Panel2.Controls.Add(this.tabSlaveGroup); 158 this.splitSlaves.Size = new System.Drawing.Size(847, 547); 159 this.splitSlaves.SplitterDistance = 249; 160 this.splitSlaves.TabIndex = 3; 161 // 162 // progressBar 163 // 164 this.progressBar.Location = new System.Drawing.Point(123, 4); 165 this.progressBar.Name = "progressBar"; 166 this.progressBar.Size = new System.Drawing.Size(123, 23); 167 this.progressBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous; 168 this.progressBar.TabIndex = 7; 169 // 154 170 // treeSlaveGroup 155 171 // 156 172 this.treeSlaveGroup.AllowDrop = true; 157 173 this.treeSlaveGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 158 159 174 | System.Windows.Forms.AnchorStyles.Left) 175 | System.Windows.Forms.AnchorStyles.Right))); 160 176 this.treeSlaveGroup.ImageIndex = 0; 161 177 this.treeSlaveGroup.ImageList = this.imageListSlaveGroups; … … 166 182 this.treeSlaveGroup.TabIndex = 0; 167 183 this.treeSlaveGroup.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.treeSlaveGroup_ItemDrag); 168 this.treeSlaveGroup. NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeSlaveGroup_NodeMouseClick);184 this.treeSlaveGroup.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeSlaveGroup_AfterSelect); 169 185 this.treeSlaveGroup.DragDrop += new System.Windows.Forms.DragEventHandler(this.treeSlaveGroup_DragDrop); 170 186 this.treeSlaveGroup.DragEnter += new System.Windows.Forms.DragEventHandler(this.treeSlaveGroup_DragEnter); … … 175 191 // 176 192 this.tabSlaveGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 177 178 193 | System.Windows.Forms.AnchorStyles.Left) 194 | System.Windows.Forms.AnchorStyles.Right))); 179 195 this.tabSlaveGroup.Controls.Add(this.tabDetails); 180 196 this.tabSlaveGroup.Controls.Add(this.tabSchedule); 197 this.tabSlaveGroup.Controls.Add(this.tabPermissions); 181 198 this.tabSlaveGroup.Location = new System.Drawing.Point(3, 3); 182 199 this.tabSlaveGroup.Name = "tabSlaveGroup"; … … 200 217 // 201 218 this.slaveView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 202 203 219 | System.Windows.Forms.AnchorStyles.Left) 220 | System.Windows.Forms.AnchorStyles.Right))); 204 221 this.slaveView.Caption = "SlaveView"; 205 222 this.slaveView.Content = null; 206 this.slaveView.Location = new System.Drawing.Point( 7, 7);223 this.slaveView.Location = new System.Drawing.Point(6, 6); 207 224 this.slaveView.Name = "slaveView"; 208 225 this.slaveView.ReadOnly = false; 209 this.slaveView.Size = new System.Drawing.Size(56 4, 502);226 this.slaveView.Size = new System.Drawing.Size(565, 503); 210 227 this.slaveView.TabIndex = 0; 211 228 // … … 224 241 // 225 242 this.scheduleView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 226 227 243 | System.Windows.Forms.AnchorStyles.Left) 244 | System.Windows.Forms.AnchorStyles.Right))); 228 245 this.scheduleView.Caption = "ScheduleView"; 229 246 this.scheduleView.Content = null; 230 this.scheduleView.Location = new System.Drawing.Point( 3, 8);247 this.scheduleView.Location = new System.Drawing.Point(6, 6); 231 248 this.scheduleView.Name = "scheduleView"; 232 249 this.scheduleView.ReadOnly = false; 233 this.scheduleView.Size = new System.Drawing.Size(56 8, 501);250 this.scheduleView.Size = new System.Drawing.Size(565, 503); 234 251 this.scheduleView.TabIndex = 0; 252 // 253 // tabPermissions 254 // 255 this.tabPermissions.Controls.Add(this.btnPermissionsSave); 256 this.tabPermissions.Controls.Add(this.permissionView); 257 this.tabPermissions.Location = new System.Drawing.Point(4, 22); 258 this.tabPermissions.Name = "tabPermissions"; 259 this.tabPermissions.Padding = new System.Windows.Forms.Padding(3); 260 this.tabPermissions.Size = new System.Drawing.Size(577, 515); 261 this.tabPermissions.TabIndex = 2; 262 this.tabPermissions.Text = "Permissions"; 263 this.tabPermissions.UseVisualStyleBackColor = true; 264 // 265 // permissionView 266 // 267 this.permissionView.Caption = "RefreshableLightweightUser View"; 268 this.permissionView.Content = null; 269 this.permissionView.FetchSelectedUsers = null; 270 this.permissionView.Location = new System.Drawing.Point(6, 6); 271 this.permissionView.Name = "permissionView"; 272 this.permissionView.ReadOnly = false; 273 this.permissionView.Size = new System.Drawing.Size(565, 503); 274 this.permissionView.TabIndex = 0; 235 275 // 236 276 // ResourcesView … … 249 289 this.tabDetails.ResumeLayout(false); 250 290 this.tabSchedule.ResumeLayout(false); 291 this.tabPermissions.ResumeLayout(false); 251 292 this.ResumeLayout(false); 252 293 … … 269 310 private System.Windows.Forms.Button btnRefresh; 270 311 private System.Windows.Forms.ToolTip toolTip; 312 private System.Windows.Forms.TabPage tabPermissions; 313 private Access.Views.RefreshableLightweightUserView permissionView; 314 private System.Windows.Forms.Button btnPermissionsSave; 271 315 } 272 316 } -
branches/HiveResourcePermissionManagement (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs
r7259 r7951 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Drawing; 24 25 using System.Linq; … … 27 28 using System.Threading.Tasks; 28 29 using System.Windows.Forms; 30 using HeuristicLab.Clients.Access; 29 31 using HeuristicLab.Clients.Hive.Views; 30 32 using HeuristicLab.Core; … … 45 47 private const int slaveImageIndex = 0; 46 48 private const int slaveGroupImageIndex = 1; 49 private readonly Color ownedResourceColor = Color.LightGreen; 47 50 private TS.Task progressTask; 48 51 private bool stopProgressTask; 52 private bool currentlyAuthorized; 49 53 50 54 … … 56 60 HiveAdminClient.Instance.Refreshing += new EventHandler(Instance_Refreshing); 57 61 HiveAdminClient.Instance.Refreshed += new EventHandler(Instance_Refreshed); 62 63 Access.AccessClient.Instance.Refreshing += new EventHandler(Content_Refreshing); 64 Access.AccessClient.Instance.Refreshed += new EventHandler(Content_Refreshed); 58 65 } 59 66 … … 61 68 HiveAdminClient.Instance.Refreshing -= new EventHandler(Instance_Refreshing); 62 69 HiveAdminClient.Instance.Refreshed -= new EventHandler(Instance_Refreshed); 70 71 Access.AccessClient.Instance.Refreshing -= new EventHandler(Content_Refreshing); 72 Access.AccessClient.Instance.Refreshed -= new EventHandler(Content_Refreshed); 63 73 } 64 74 … … 87 97 progressTask = new TS.Task(UpdateProgress); 88 98 progressTask.Start(); 99 SetEnabledStateOfControls(false); 89 100 } 90 101 91 102 void Instance_Refreshed(object sender, EventArgs e) { 92 103 stopProgressTask = true; 104 SetEnabledStateOfControls(true); 105 } 106 107 void Content_Refreshing(object sender, EventArgs e) { 108 stopProgressTask = false; 109 progressTask = new TS.Task(UpdateProgress); 110 progressTask.Start(); 111 SetEnabledStateOfControls(false); 112 } 113 114 void Content_Refreshed(object sender, EventArgs e) { 115 stopProgressTask = true; 116 SetEnabledStateOfControls(true); 93 117 } 94 118 … … 110 134 if (Content == null) { 111 135 slaveView.Content = null; 136 scheduleView.Content = null; 137 permissionView.Content = null; 138 permissionView.FetchSelectedUsers = null; 112 139 treeSlaveGroup.Nodes.Clear(); 113 140 } else { 141 permissionView.Content = Access.AccessClient.Instance; 114 142 treeSlaveGroup.Nodes.Clear(); 115 143 … … 134 162 tn.Tag = g; 135 163 tn.Text = g.Name; 164 if (g.OwnerUserId == Access.UserInformation.Instance.User.Id) tn.BackColor = ownedResourceColor; 136 165 137 166 BuildSlaveGroupTree(g, tn); … … 144 173 stn.SelectedImageIndex = stn.ImageIndex; 145 174 stn.Tag = g; 175 if (g.OwnerUserId == Access.UserInformation.Instance.User.Id) stn.BackColor = ownedResourceColor; 146 176 ungrp.Nodes.Add(stn); 147 177 } … … 162 192 stn.SelectedImageIndex = stn.ImageIndex; 163 193 stn.Tag = r; 194 if (r.OwnerUserId == Access.UserInformation.Instance.User.Id) stn.BackColor = ownedResourceColor; 164 195 tn.Nodes.Add(stn); 165 196 … … 174 205 btnRemoveGroup.Enabled = false; 175 206 btnSave.Enabled = false; 207 btnPermissionsSave.Enabled = false; 208 permissionView.Enabled = false; 176 209 } else { 177 210 btnAddGroup.Enabled = true; … … 181 214 } 182 215 183 private void treeSlaveGroup_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { 184 if (slaveView.Content != null && slaveView.Content is SlaveGroup) { 185 slaveView.Content.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged); 186 } 187 188 slaveView.Content = (Resource)e.Node.Tag; 189 HiveAdminClient.Instance.DowntimeForResourceId = ((Resource)e.Node.Tag).Id; 190 191 if (e.Node.Tag is SlaveGroup) { 192 slaveView.Content.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged); 193 } 194 195 if (tabSlaveGroup.SelectedIndex == 1) { 196 UpdateScheduleAsync(); 216 public virtual void SetEnabledStateOfControls(bool state) { 217 if (InvokeRequired) { 218 Invoke(new Action(() => SetEnabledStateOfControls(state))); 219 } else { 220 if (Content == null) state = false; 221 btnAddGroup.Enabled = state; 222 btnRemoveGroup.Enabled = state; 223 btnSave.Enabled = state; 224 scheduleView.SetEnabledStateOfControls(state && IsAuthorized(slaveView.Content)); 225 btnPermissionsSave.Enabled = state && permissionView.FetchSelectedUsers != null && Content != null; 226 permissionView.Enabled = state && permissionView.FetchSelectedUsers != null && Content != null; 227 } 228 } 229 230 private bool IsAuthorized(Resource resource) { 231 return resource != null 232 && resource.Name != UngroupedGroupName 233 && resource.Id != Guid.Empty 234 && HiveServiceLocator.Instance.CallHiveService<bool>(service => { return service.AuthorizesForResourceAdministration(resource.Id); }); 235 } 236 237 private void treeSlaveGroup_AfterSelect(object sender, TreeViewEventArgs e) { 238 if (e.Action != TreeViewAction.Unknown) { 239 Resource selectedResource = ((Resource)e.Node.Tag); 240 currentlyAuthorized = IsAuthorized(selectedResource); 241 if (currentlyAuthorized) { 242 permissionView.FetchSelectedUsers = new Func<List<Guid>>(() => { 243 return HiveServiceLocator.Instance.CallHiveService<List<ResourcePermission>>(service => { 244 return service.GetResourcePermissions(selectedResource.Id); 245 }).Select(x => x.GrantedUserId).ToList(); 246 }); 247 if (!tabSlaveGroup.TabPages.Contains(tabPermissions)) tabSlaveGroup.TabPages.Add(tabPermissions); 248 } else { 249 permissionView.FetchSelectedUsers = null; 250 btnPermissionsSave.Enabled = false; 251 if (selectedResource.Id == Guid.Empty) { 252 if (!tabSlaveGroup.TabPages.Contains(tabPermissions)) tabSlaveGroup.TabPages.Add(tabPermissions); 253 } else tabSlaveGroup.TabPages.Remove(tabPermissions); 254 } 255 256 if (slaveView.Content != null && slaveView.Content is SlaveGroup) { 257 slaveView.Content.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged); 258 } 259 260 slaveView.Content = selectedResource; 261 HiveAdminClient.Instance.DowntimeForResourceId = selectedResource.Id; 262 263 if (selectedResource is SlaveGroup) { 264 slaveView.Content.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged); 265 } 266 267 if (tabSlaveGroup.SelectedIndex == 1) { 268 UpdateScheduleAsync(); 269 } else if (tabSlaveGroup.SelectedIndex == 2) { 270 UpdatePermissionsAsync(); 271 } 197 272 } 198 273 } … … 217 292 SlaveGroup newGroup = new SlaveGroup(); 218 293 newGroup.Name = "New Group"; 294 newGroup.OwnerUserId = UserInformation.Instance.User.Id; 219 295 Content.Add(newGroup); 220 296 } … … 269 345 if (destNode.TreeView == newNode.TreeView) { 270 346 if (destNode.Text == UngroupedGroupName || (destNode.Parent != null && destNode.Parent.Text == UngroupedGroupName)) { 271 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.",347 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.", 272 348 UngroupedGroupName, Environment.NewLine), "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Information); 273 349 return; … … 285 361 286 362 if (newNode.Tag is SlaveGroup && CheckParentsEqualsMovedNode(parentNode, newNode)) { 363 return; 364 } 365 366 SlaveGroup parent = (SlaveGroup)parentNode.Tag; 367 368 if (parent.OwnerUserId != null && !IsAuthorized(parent)) { 369 MessageBox.Show(string.Format("You don't have the permissions to drag items to the group \"{0}\".", ((Resource)parentNode.Tag).Name), 370 "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error); 287 371 return; 288 372 } … … 330 414 private void treeSlaveGroup_ItemDrag(object sender, ItemDragEventArgs e) { 331 415 TreeNode sourceNode = (TreeNode)e.Item; 332 DoDragDrop(sourceNode, DragDropEffects.All); 416 if (IsAuthorized((Resource)sourceNode.Tag)) 417 DoDragDrop(sourceNode, DragDropEffects.All); 333 418 } 334 419 … … 403 488 private void UpdateSchedule() { 404 489 HiveAdminClient.Instance.RefreshCalendar(); 405 scheduleView.Invoke(new Action(() => scheduleView.Content = HiveAdminClient.Instance.Downtimes)); 490 scheduleView.Invoke(new Action(() => { 491 scheduleView.Content = HiveAdminClient.Instance.Downtimes; 492 SetEnabledStateOfControls(currentlyAuthorized); 493 })); 406 494 } 407 495 … … 412 500 } 413 501 502 private void UpdatePermissions() { 503 if (permissionView.Content != null && permissionView.FetchSelectedUsers != null) 504 permissionView.Invoke(new Action(() => permissionView.ManualRefresh())); 505 } 506 507 private void UpdatePermissionsAsync() { 508 TS.Task.Factory.StartNew(UpdatePermissions).ContinueWith((t) => { 509 DisplayError(t.Exception); 510 }, TaskContinuationOptions.OnlyOnFaulted); 511 } 512 513 414 514 private void DisplayError(Exception ex) { 415 515 MessageBox.Show(string.Format("An error occured while updating: {0} {1}", Environment.NewLine, ex.Message), "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error); … … 419 519 if (tabSlaveGroup.SelectedIndex == 1) { 420 520 UpdateScheduleAsync(); 521 } else if (tabSlaveGroup.SelectedIndex == 2) { 522 UpdatePermissionsAsync(); 421 523 } 422 524 } … … 429 531 UpdateResourcesAsync(); 430 532 } 533 534 private void btnPermissionsSave_Click(object sender, EventArgs e) { 535 SetEnabledStateOfControls(false); 536 HiveServiceLocator.Instance.CallHiveService(service => { 537 service.GrantResourcePermissions(((Resource)treeSlaveGroup.SelectedNode.Tag).Id, permissionView.GetAddedUsers().Select(x => x.Id).ToList()); 538 service.RevokeResourcePermissions(((Resource)treeSlaveGroup.SelectedNode.Tag).Id, permissionView.GetDeletedUsers().Select(x => x.Id).ToList()); 539 }); 540 SetEnabledStateOfControls(true); 541 } 431 542 } 432 543 } -
branches/HiveResourcePermissionManagement (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ScheduleView.Designer.cs
r7259 r7951 71 71 this.dvOnline.ActiveTool = drawTool1; 72 72 this.dvOnline.AmPmDisplay = false; 73 this.dvOnline.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles. Bottom)74 | System.Windows.Forms.AnchorStyles.Left)));73 this.dvOnline.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 74 | System.Windows.Forms.AnchorStyles.Right))); 75 75 this.dvOnline.AppointmentDuration = Calendar.AppointmentSlotDuration.SixtyMinutes; 76 76 this.dvOnline.AppointmentHeightMode = Calendar.AppHeightDrawMode.TrueHeightAll; … … 83 83 this.dvOnline.EnableTimeIndicator = false; 84 84 this.dvOnline.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F); 85 this.dvOnline.Location = new System.Drawing.Point( 9, 176);85 this.dvOnline.Location = new System.Drawing.Point(3, 183); 86 86 this.dvOnline.MinHalfHourApp = false; 87 87 this.dvOnline.Name = "dvOnline"; 88 88 this.dvOnline.SelectionEnd = new System.DateTime(((long)(0))); 89 89 this.dvOnline.SelectionStart = new System.DateTime(((long)(0))); 90 this.dvOnline.Size = new System.Drawing.Size(8 23, 354);90 this.dvOnline.Size = new System.Drawing.Size(836, 354); 91 91 this.dvOnline.StartDate = new System.DateTime(((long)(0))); 92 92 this.dvOnline.TabIndex = 54; … … 123 123 // groupBox1 124 124 // 125 this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 125 126 this.groupBox1.Controls.Add(this.txttimeTo); 126 127 this.groupBox1.Controls.Add(this.txttimeFrom); … … 133 134 this.groupBox1.Controls.Add(this.label1); 134 135 this.groupBox1.Controls.Add(this.btCreate); 135 this.groupBox1.Location = new System.Drawing.Point(37 3, 4);136 this.groupBox1.Location = new System.Drawing.Point(375, 3); 136 137 this.groupBox1.Name = "groupBox1"; 137 this.groupBox1.Size = new System.Drawing.Size(25 4, 161);138 this.groupBox1.Size = new System.Drawing.Size(259, 168); 138 139 this.groupBox1.TabIndex = 56; 139 140 this.groupBox1.TabStop = false; … … 217 218 // btnSaveCal 218 219 // 220 this.btnSaveCal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 219 221 this.btnSaveCal.Image = HeuristicLab.Common.Resources.VSImageLibrary.PublishToWeb; 220 222 this.btnSaveCal.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; 221 this.btnSaveCal.Location = new System.Drawing.Point(6 33, 41);223 this.btnSaveCal.Location = new System.Drawing.Point(640, 41); 222 224 this.btnSaveCal.Name = "btnSaveCal"; 223 225 this.btnSaveCal.Size = new System.Drawing.Size(199, 26); … … 230 232 // btnClearCal 231 233 // 234 this.btnClearCal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 232 235 this.btnClearCal.Image = HeuristicLab.Common.Resources.VSImageLibrary.Document; 233 236 this.btnClearCal.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; 234 this.btnClearCal.Location = new System.Drawing.Point(6 33, 9);237 this.btnClearCal.Location = new System.Drawing.Point(640, 9); 235 238 this.btnClearCal.Name = "btnClearCal"; 236 239 this.btnClearCal.Size = new System.Drawing.Size(199, 26); … … 243 246 // mcOnline 244 247 // 248 this.mcOnline.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 249 | System.Windows.Forms.AnchorStyles.Right))); 245 250 this.mcOnline.CalendarDimensions = new System.Drawing.Size(2, 1); 246 this.mcOnline.Location = new System.Drawing.Point( 4, 9);251 this.mcOnline.Location = new System.Drawing.Point(3, 9); 247 252 this.mcOnline.Name = "mcOnline"; 248 253 this.mcOnline.TabIndex = 55; -
branches/HiveResourcePermissionManagement (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ScheduleView.cs
r7259 r7951 228 228 protected override void SetEnabledStateOfControls() { 229 229 base.SetEnabledStateOfControls(); 230 if (Content == null) { 231 btnSaveCal.Enabled = false; 230 } 231 232 public virtual void SetEnabledStateOfControls(bool state) { 233 if (InvokeRequired) { 234 Invoke(new Action(() => SetEnabledStateOfControls(state))); 232 235 } else { 233 btnSaveCal.Enabled = true; 236 if (Content == null) state = false; 237 groupBox1.Enabled = state; 238 btnClearCal.Enabled = state; 239 btnSaveCal.Enabled = state; 234 240 } 235 241 } -
branches/HiveResourcePermissionManagement (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Views/SlaveView.Designer.cs
r7857 r7951 67 67 this.cbxDisposable = new System.Windows.Forms.CheckBox(); 68 68 this.label4 = new System.Windows.Forms.Label(); 69 this.cbxPublic = new System.Windows.Forms.CheckBox(); 70 this.label5 = new System.Windows.Forms.Label(); 69 71 this.SuspendLayout(); 70 72 // … … 74 76 | System.Windows.Forms.AnchorStyles.Right))); 75 77 this.txtSlaveState.Enabled = false; 76 this.txtSlaveState.Location = new System.Drawing.Point(146, 2 16);78 this.txtSlaveState.Location = new System.Drawing.Point(146, 242); 77 79 this.txtSlaveState.Name = "txtSlaveState"; 78 80 this.txtSlaveState.Size = new System.Drawing.Size(390, 20); … … 84 86 | System.Windows.Forms.AnchorStyles.Right))); 85 87 this.txtOS.Enabled = false; 86 this.txtOS.Location = new System.Drawing.Point(146, 190);88 this.txtOS.Location = new System.Drawing.Point(146, 216); 87 89 this.txtOS.Name = "txtOS"; 88 90 this.txtOS.Size = new System.Drawing.Size(390, 20); … … 92 94 // 93 95 this.label15.AutoSize = true; 94 this.label15.Location = new System.Drawing.Point(3, 2 19);96 this.label15.Location = new System.Drawing.Point(3, 245); 95 97 this.label15.Name = "label15"; 96 98 this.label15.Size = new System.Drawing.Size(35, 13); … … 101 103 // 102 104 this.label14.AutoSize = true; 103 this.label14.Location = new System.Drawing.Point(3, 193);105 this.label14.Location = new System.Drawing.Point(3, 219); 104 106 this.label14.Name = "label14"; 105 107 this.label14.Size = new System.Drawing.Size(93, 13); … … 112 114 | System.Windows.Forms.AnchorStyles.Right))); 113 115 this.txtDetailsDescription.Enabled = false; 114 this.txtDetailsDescription.Location = new System.Drawing.Point(146, 86);116 this.txtDetailsDescription.Location = new System.Drawing.Point(146, 112); 115 117 this.txtDetailsDescription.Name = "txtDetailsDescription"; 116 118 this.txtDetailsDescription.Size = new System.Drawing.Size(390, 20); … … 120 122 // 121 123 this.label13.AutoSize = true; 122 this.label13.Location = new System.Drawing.Point(3, 89);124 this.label13.Location = new System.Drawing.Point(3, 115); 123 125 this.label13.Name = "label13"; 124 126 this.label13.Size = new System.Drawing.Size(63, 13); … … 141 143 | System.Windows.Forms.AnchorStyles.Right))); 142 144 this.txtCPU.Enabled = false; 143 this.txtCPU.Location = new System.Drawing.Point(146, 1 12);145 this.txtCPU.Location = new System.Drawing.Point(146, 138); 144 146 this.txtCPU.Name = "txtCPU"; 145 147 this.txtCPU.Size = new System.Drawing.Size(390, 20); … … 151 153 | System.Windows.Forms.AnchorStyles.Right))); 152 154 this.txtMemory.Enabled = false; 153 this.txtMemory.Location = new System.Drawing.Point(146, 1 38);155 this.txtMemory.Location = new System.Drawing.Point(146, 164); 154 156 this.txtMemory.Name = "txtMemory"; 155 157 this.txtMemory.Size = new System.Drawing.Size(390, 20); … … 161 163 | System.Windows.Forms.AnchorStyles.Right))); 162 164 this.txtLastHeartbeat.Enabled = false; 163 this.txtLastHeartbeat.Location = new System.Drawing.Point(146, 2 42);165 this.txtLastHeartbeat.Location = new System.Drawing.Point(146, 268); 164 166 this.txtLastHeartbeat.Name = "txtLastHeartbeat"; 165 167 this.txtLastHeartbeat.Size = new System.Drawing.Size(390, 20); … … 169 171 // 170 172 this.label12.AutoSize = true; 171 this.label12.Location = new System.Drawing.Point(3, 2 45);173 this.label12.Location = new System.Drawing.Point(3, 271); 172 174 this.label12.Name = "label12"; 173 175 this.label12.Size = new System.Drawing.Size(80, 13); … … 178 180 // 179 181 this.label11.AutoSize = true; 180 this.label11.Location = new System.Drawing.Point(3, 1 41);182 this.label11.Location = new System.Drawing.Point(3, 167); 181 183 this.label11.Name = "label11"; 182 184 this.label11.Size = new System.Drawing.Size(47, 13); … … 187 189 // 188 190 this.label10.AutoSize = true; 189 this.label10.Location = new System.Drawing.Point(3, 1 15);191 this.label10.Location = new System.Drawing.Point(3, 141); 190 192 this.label10.Name = "label10"; 191 193 this.label10.Size = new System.Drawing.Size(32, 13); … … 205 207 // 206 208 this.label1.AutoSize = true; 207 this.label1.Location = new System.Drawing.Point(3, 1 67);209 this.label1.Location = new System.Drawing.Point(3, 193); 208 210 this.label1.Name = "label1"; 209 211 this.label1.Size = new System.Drawing.Size(70, 13); … … 216 218 | System.Windows.Forms.AnchorStyles.Right))); 217 219 this.txtFreeMemory.Enabled = false; 218 this.txtFreeMemory.Location = new System.Drawing.Point(146, 1 64);220 this.txtFreeMemory.Location = new System.Drawing.Point(146, 190); 219 221 this.txtFreeMemory.Name = "txtFreeMemory"; 220 222 this.txtFreeMemory.Size = new System.Drawing.Size(390, 20); … … 226 228 | System.Windows.Forms.AnchorStyles.Right))); 227 229 this.txtId.Enabled = false; 228 this.txtId.Location = new System.Drawing.Point(146, 60);230 this.txtId.Location = new System.Drawing.Point(146, 86); 229 231 this.txtId.Name = "txtId"; 230 232 this.txtId.Size = new System.Drawing.Size(390, 20); … … 234 236 // 235 237 this.label2.AutoSize = true; 236 this.label2.Location = new System.Drawing.Point(3, 63);238 this.label2.Location = new System.Drawing.Point(3, 89); 237 239 this.label2.Name = "label2"; 238 240 this.label2.Size = new System.Drawing.Size(19, 13); … … 262 264 // 263 265 this.cbxDisposable.AutoSize = true; 264 this.cbxDisposable.Location = new System.Drawing.Point(146, 268); 266 this.cbxDisposable.Enabled = false; 267 this.cbxDisposable.Location = new System.Drawing.Point(146, 297); 265 268 this.cbxDisposable.Name = "cbxDisposable"; 266 269 this.cbxDisposable.Size = new System.Drawing.Size(15, 14); 267 270 this.cbxDisposable.TabIndex = 34; 268 271 this.cbxDisposable.UseVisualStyleBackColor = true; 269 this.cbxDisposable.CheckedChanged += new System.EventHandler(this.c heckBox1_CheckedChanged);272 this.cbxDisposable.CheckedChanged += new System.EventHandler(this.cbxDisposable_CheckedChanged); 270 273 // 271 274 // label4 272 275 // 273 276 this.label4.AutoSize = true; 274 this.label4.Location = new System.Drawing.Point(3, 2 69);277 this.label4.Location = new System.Drawing.Point(3, 297); 275 278 this.label4.Name = "label4"; 276 279 this.label4.Size = new System.Drawing.Size(62, 13); … … 278 281 this.label4.Text = "Disposable:"; 279 282 // 283 // cbxPublic 284 // 285 this.cbxPublic.AutoSize = true; 286 this.cbxPublic.Enabled = false; 287 this.cbxPublic.Location = new System.Drawing.Point(146, 63); 288 this.cbxPublic.Name = "cbxPublic"; 289 this.cbxPublic.Size = new System.Drawing.Size(15, 14); 290 this.cbxPublic.TabIndex = 36; 291 this.cbxPublic.UseVisualStyleBackColor = true; 292 this.cbxPublic.CheckedChanged += new System.EventHandler(this.cbxPublic_CheckedChanged); 293 // 294 // label5 295 // 296 this.label5.AutoSize = true; 297 this.label5.Location = new System.Drawing.Point(3, 63); 298 this.label5.Name = "label5"; 299 this.label5.Size = new System.Drawing.Size(39, 13); 300 this.label5.TabIndex = 37; 301 this.label5.Text = "Public:"; 302 // 280 303 // SlaveView 281 304 // 282 305 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 283 306 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 307 this.Controls.Add(this.label5); 308 this.Controls.Add(this.cbxPublic); 284 309 this.Controls.Add(this.label4); 285 310 this.Controls.Add(this.cbxDisposable); … … 305 330 this.Controls.Add(this.label9); 306 331 this.Name = "SlaveView"; 307 this.Size = new System.Drawing.Size(539, 285);332 this.Size = new System.Drawing.Size(539, 407); 308 333 this.ResumeLayout(false); 309 334 this.PerformLayout(); … … 335 360 private System.Windows.Forms.CheckBox cbxDisposable; 336 361 private System.Windows.Forms.Label label4; 362 private System.Windows.Forms.CheckBox cbxPublic; 363 private System.Windows.Forms.Label label5; 337 364 } 338 365 } -
branches/HiveResourcePermissionManagement (trunk integration)/HeuristicLab.Clients.Hive.Administrator/3.3/Views/SlaveView.cs
r7862 r7951 22 22 using System; 23 23 using System.Windows.Forms; 24 using HeuristicLab.Clients.Access; 24 25 using HeuristicLab.Core.Views; 25 26 using HeuristicLab.MainForm; … … 63 64 txtHbIntervall.Clear(); 64 65 cbxDisposable.Checked = false; 66 cbxPublic.Checked = false; 65 67 } else { 66 68 if (Content.GetType() == typeof(Slave)) { 67 69 ShowSlaveUI(true); 68 70 Slave ct = (Slave)Content; 71 bool authorized = HiveServiceLocator.Instance.CallHiveService<bool>(service => service.AuthorizesForResourceAdministration(ct.Id)); 69 72 txtName.Text = ct.Name; 70 73 txtHbIntervall.Text = ct.HbInterval.ToString(); 71 cbxDisposable.Checked = ct.IsDisposable.GetValueOrDefault(); 74 cbxPublic.Enabled = authorized; 75 cbxPublic.CheckedChanged -= new EventHandler(cbxPublic_CheckedChanged); 76 cbxPublic.Checked = ct.OwnerUserId == null; 77 cbxPublic.CheckedChanged += new EventHandler(cbxPublic_CheckedChanged); 72 78 txtCPU.Text = string.Format("{0} Cores @ {1} Mhz, Arch.: {2}", ct.Cores.ToString(), ct.CpuSpeed.ToString(), ct.CpuArchitecture.ToString()); 73 79 txtDetailsDescription.Text = ct.Description; … … 78 84 txtFreeMemory.Text = ct.FreeMemory.ToString(); 79 85 txtId.Text = ct.Id.ToString(); 86 cbxDisposable.Enabled = authorized; 87 cbxDisposable.Checked = ct.IsDisposable.GetValueOrDefault(); 80 88 } else if (Content.GetType() == typeof(SlaveGroup)) { 81 89 SlaveGroup ct = (SlaveGroup)Content; 82 90 txtName.Text = ct.Name; 83 91 txtHbIntervall.Text = ct.HbInterval.ToString(); 92 cbxPublic.Enabled = ct.Name != "UNGROUPED" && HiveRoles.CheckAdminUserPermissions(); 93 cbxPublic.CheckedChanged -= new EventHandler(cbxPublic_CheckedChanged); 94 cbxPublic.Checked = ct.OwnerUserId == null; 95 cbxPublic.CheckedChanged += new EventHandler(cbxPublic_CheckedChanged); 84 96 ShowSlaveUI(false); 85 97 } else { … … 136 148 } 137 149 138 private void c heckBox1_CheckedChanged(object sender, EventArgs e) {150 private void cbxDisposable_CheckedChanged(object sender, EventArgs e) { 139 151 if (Content != null) { 140 152 ((Slave)Content).IsDisposable = cbxDisposable.Checked; 141 153 } 142 154 } 155 156 private void cbxPublic_CheckedChanged(object sender, EventArgs e) { 157 if (Content != null) { 158 Content.OwnerUserId = cbxPublic.Checked ? null : new Guid?(UserInformation.Instance.User.Id); 159 } 160 } 143 161 } 144 162 } -
branches/HiveResourcePermissionManagement (trunk integration)/HeuristicLab.Clients.Hive/3.3/ServiceClients/HiveServiceClient.cs
r7916 r7951 2 2 // <auto-generated> 3 3 // This code was generated by a tool. 4 // Runtime Version:4.0.30319. 2694 // Runtime Version:4.0.30319.17379 5 5 // 6 6 // Changes to this file may cause incorrect behavior and will be lost if … … 422 422 [System.Diagnostics.DebuggerStepThroughAttribute()] 423 423 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 424 [System.Runtime.Serialization.DataContractAttribute(Name = "Downtime", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")] 425 [System.SerializableAttribute()] 426 public partial class Downtime : HeuristicLab.Clients.Hive.HiveItem { 427 428 [System.Runtime.Serialization.OptionalFieldAttribute()] 429 private bool AllDayEventField; 430 431 [System.Runtime.Serialization.OptionalFieldAttribute()] 432 private System.DateTime EndDateField; 433 434 [System.Runtime.Serialization.OptionalFieldAttribute()] 435 private bool RecurringField; 436 437 [System.Runtime.Serialization.OptionalFieldAttribute()] 438 private System.Guid RecurringIdField; 439 440 [System.Runtime.Serialization.OptionalFieldAttribute()] 441 private System.Guid ResourceIdField; 442 443 [System.Runtime.Serialization.OptionalFieldAttribute()] 444 private System.DateTime StartDateField; 445 446 [System.Runtime.Serialization.DataMemberAttribute()] 447 public bool AllDayEvent { 448 get { 449 return this.AllDayEventField; 450 } 451 set { 452 if ((this.AllDayEventField.Equals(value) != true)) { 453 this.AllDayEventField = value; 454 this.RaisePropertyChanged("AllDayEvent"); 455 } 456 } 457 } 458 459 [System.Runtime.Serialization.DataMemberAttribute()] 460 public System.DateTime EndDate { 461 get { 462 return this.EndDateField; 463 } 464 set { 465 if ((this.EndDateField.Equals(value) != true)) { 466 this.EndDateField = value; 467 this.RaisePropertyChanged("EndDate"); 468 } 469 } 470 } 471 472 [System.Runtime.Serialization.DataMemberAttribute()] 473 public bool Recurring { 474 get { 475 return this.RecurringField; 476 } 477 set { 478 if ((this.RecurringField.Equals(value) != true)) { 479 this.RecurringField = value; 480 this.RaisePropertyChanged("Recurring"); 481 } 482 } 483 } 484 485 [System.Runtime.Serialization.DataMemberAttribute()] 486 public System.Guid RecurringId { 487 get { 488 return this.RecurringIdField; 489 } 490 set { 491 if ((this.RecurringIdField.Equals(value) != true)) { 492 this.RecurringIdField = value; 493 this.RaisePropertyChanged("RecurringId"); 494 } 495 } 496 } 497 498 [System.Runtime.Serialization.DataMemberAttribute()] 499 public System.Guid ResourceId { 500 get { 501 return this.ResourceIdField; 502 } 503 set { 504 if ((this.ResourceIdField.Equals(value) != true)) { 505 this.ResourceIdField = value; 506 this.RaisePropertyChanged("ResourceId"); 507 } 508 } 509 } 510 511 [System.Runtime.Serialization.DataMemberAttribute()] 512 public System.DateTime StartDate { 513 get { 514 return this.StartDateField; 515 } 516 set { 517 if ((this.StartDateField.Equals(value) != true)) { 518 this.StartDateField = value; 519 this.RaisePropertyChanged("StartDate"); 520 } 521 } 522 } 523 } 524 525 [System.Diagnostics.DebuggerStepThroughAttribute()] 526 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 527 [System.Runtime.Serialization.DataContractAttribute(Name = "JobPermission", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")] 528 [System.SerializableAttribute()] 529 public partial class JobPermission : HeuristicLab.Clients.Hive.HiveItem { 530 531 [System.Runtime.Serialization.OptionalFieldAttribute()] 532 private System.Guid GrantedByUserIdField; 533 534 [System.Runtime.Serialization.OptionalFieldAttribute()] 535 private System.Guid GrantedUserIdField; 536 537 [System.Runtime.Serialization.OptionalFieldAttribute()] 538 private System.Guid JobIdField; 539 540 [System.Runtime.Serialization.OptionalFieldAttribute()] 541 private HeuristicLab.Clients.Hive.Permission PermissionField; 542 543 [System.Runtime.Serialization.DataMemberAttribute()] 544 public System.Guid GrantedByUserId { 545 get { 546 return this.GrantedByUserIdField; 547 } 548 set { 549 if ((this.GrantedByUserIdField.Equals(value) != true)) { 550 this.GrantedByUserIdField = value; 551 this.RaisePropertyChanged("GrantedByUserId"); 552 } 553 } 554 } 555 556 [System.Runtime.Serialization.DataMemberAttribute()] 557 public System.Guid GrantedUserId { 558 get { 559 return this.GrantedUserIdField; 560 } 561 set { 562 if ((this.GrantedUserIdField.Equals(value) != true)) { 563 this.GrantedUserIdField = value; 564 this.RaisePropertyChanged("GrantedUserId"); 565 } 566 } 567 } 568 569 [System.Runtime.Serialization.DataMemberAttribute()] 570 public System.Guid JobId { 571 get { 572 return this.JobIdField; 573 } 574 set { 575 if ((this.JobIdField.Equals(value) != true)) { 576 this.JobIdField = value; 577 this.RaisePropertyChanged("JobId"); 578 } 579 } 580 } 581 582 [System.Runtime.Serialization.DataMemberAttribute()] 583 public HeuristicLab.Clients.Hive.Permission Permission { 584 get { 585 return this.PermissionField; 586 } 587 set { 588 if ((this.PermissionField.Equals(value) != true)) { 589 this.PermissionField = value; 590 this.RaisePropertyChanged("Permission"); 591 } 592 } 593 } 594 } 595 596 [System.Diagnostics.DebuggerStepThroughAttribute()] 597 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 598 [System.Runtime.Serialization.DataContractAttribute(Name = "PluginData", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")] 599 [System.SerializableAttribute()] 600 public partial class PluginData : HeuristicLab.Clients.Hive.HiveItem { 601 602 [System.Runtime.Serialization.OptionalFieldAttribute()] 603 private byte[] DataField; 604 605 [System.Runtime.Serialization.OptionalFieldAttribute()] 606 private string FileNameField; 607 608 [System.Runtime.Serialization.OptionalFieldAttribute()] 609 private System.Guid PluginIdField; 610 611 [System.Runtime.Serialization.DataMemberAttribute()] 612 public byte[] Data { 613 get { 614 return this.DataField; 615 } 616 set { 617 if ((object.ReferenceEquals(this.DataField, value) != true)) { 618 this.DataField = value; 619 this.RaisePropertyChanged("Data"); 620 } 621 } 622 } 623 624 [System.Runtime.Serialization.DataMemberAttribute()] 625 public string FileName { 626 get { 627 return this.FileNameField; 628 } 629 set { 630 if ((object.ReferenceEquals(this.FileNameField, value) != true)) { 631 this.FileNameField = value; 632 this.RaisePropertyChanged("FileName"); 633 } 634 } 635 } 636 637 [System.Runtime.Serialization.DataMemberAttribute()] 638 public System.Guid PluginId { 639 get { 640 return this.PluginIdField; 641 } 642 set { 643 if ((this.PluginIdField.Equals(value) != true)) { 644 this.PluginIdField = value; 645 this.RaisePropertyChanged("PluginId"); 646 } 647 } 648 } 649 } 650 651 [System.Diagnostics.DebuggerStepThroughAttribute()] 652 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] 424 653 [System.Runtime.Serialization.DataContractAttribute(Name = "ResourcePermission", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")] 425 654 [System.SerializableAttribute()] … … 470 699 this.ResourceIdField = value; 471 700 this.RaisePropertyChanged("ResourceId"); 472 }473 }474 }475 }476 477 [System.Diagnostics.DebuggerStepThroughAttribute()]478 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]479 [System.Runtime.Serialization.DataContractAttribute(Name = "Downtime", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")]480 [System.SerializableAttribute()]481 public partial class Downtime : HeuristicLab.Clients.Hive.HiveItem {482 483 [System.Runtime.Serialization.OptionalFieldAttribute()]484 private bool AllDayEventField;485 486 [System.Runtime.Serialization.OptionalFieldAttribute()]487 private System.DateTime EndDateField;488 489 [System.Runtime.Serialization.OptionalFieldAttribute()]490 private bool RecurringField;491 492 [System.Runtime.Serialization.OptionalFieldAttribute()]493 private System.Guid RecurringIdField;494 495 [System.Runtime.Serialization.OptionalFieldAttribute()]496 private System.Guid ResourceIdField;497 498 [System.Runtime.Serialization.OptionalFieldAttribute()]499 private System.DateTime StartDateField;500 501 [System.Runtime.Serialization.DataMemberAttribute()]502 public bool AllDayEvent {503 get {504 return this.AllDayEventField;505 }506 set {507 if ((this.AllDayEventField.Equals(value) != true)) {508 this.AllDayEventField = value;509 this.RaisePropertyChanged("AllDayEvent");510 }511 }512 }513 514 [System.Runtime.Serialization.DataMemberAttribute()]515 public System.DateTime EndDate {516 get {517 return this.EndDateField;518 }519 set {520 if ((this.EndDateField.Equals(value) != true)) {521 this.EndDateField = value;522 this.RaisePropertyChanged("EndDate");523 }524 }525 }526 527 [System.Runtime.Serialization.DataMemberAttribute()]528 public bool Recurring {529 get {530 return this.RecurringField;531 }532 set {533 if ((this.RecurringField.Equals(value) != true)) {534 this.RecurringField = value;535 this.RaisePropertyChanged("Recurring");536 }537 }538 }539 540 [System.Runtime.Serialization.DataMemberAttribute()]541 public System.Guid RecurringId {542 get {543 return this.RecurringIdField;544 }545 set {546 if ((this.RecurringIdField.Equals(value) != true)) {547 this.RecurringIdField = value;548 this.RaisePropertyChanged("RecurringId");549 }550 }551 }552 553 [System.Runtime.Serialization.DataMemberAttribute()]554 public System.Guid ResourceId {555 get {556 return this.ResourceIdField;557 }558 set {559 if ((this.ResourceIdField.Equals(value) != true)) {560 this.ResourceIdField = value;561 this.RaisePropertyChanged("ResourceId");562 }563 }564 }565 566 [System.Runtime.Serialization.DataMemberAttribute()]567 public System.DateTime StartDate {568 get {569 return this.StartDateField;570 }571 set {572 if ((this.StartDateField.Equals(value) != true)) {573 this.StartDateField = value;574 this.RaisePropertyChanged("StartDate");575 }576 }577 }578 }579 580 [System.Diagnostics.DebuggerStepThroughAttribute()]581 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]582 [System.Runtime.Serialization.DataContractAttribute(Name = "JobPermission", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")]583 [System.SerializableAttribute()]584 public partial class JobPermission : HeuristicLab.Clients.Hive.HiveItem {585 586 [System.Runtime.Serialization.OptionalFieldAttribute()]587 private System.Guid GrantedByUserIdField;588 589 [System.Runtime.Serialization.OptionalFieldAttribute()]590 private System.Guid GrantedUserIdField;591 592 [System.Runtime.Serialization.OptionalFieldAttribute()]593 private System.Guid JobIdField;594 595 [System.Runtime.Serialization.OptionalFieldAttribute()]596 private HeuristicLab.Clients.Hive.Permission PermissionField;597 598 [System.Runtime.Serialization.DataMemberAttribute()]599 public System.Guid GrantedByUserId {600 get {601 return this.GrantedByUserIdField;602 }603 set {604 if ((this.GrantedByUserIdField.Equals(value) != true)) {605 this.GrantedByUserIdField = value;606 this.RaisePropertyChanged("GrantedByUserId");607 }608 }609 }610 611 [System.Runtime.Serialization.DataMemberAttribute()]612 public System.Guid GrantedUserId {613 get {614 return this.GrantedUserIdField;615 }616 set {617 if ((this.GrantedUserIdField.Equals(value) != true)) {618 this.GrantedUserIdField = value;619 this.RaisePropertyChanged("GrantedUserId");620 }621 }622 }623 624 [System.Runtime.Serialization.DataMemberAttribute()]625 public System.Guid JobId {626 get {627 return this.JobIdField;628 }629 set {630 if ((this.JobIdField.Equals(value) != true)) {631 this.JobIdField = value;632 this.RaisePropertyChanged("JobId");633 }634 }635 }636 637 [System.Runtime.Serialization.DataMemberAttribute()]638 public HeuristicLab.Clients.Hive.Permission Permission {639 get {640 return this.PermissionField;641 }642 set {643 if ((this.PermissionField.Equals(value) != true)) {644 this.PermissionField = value;645 this.RaisePropertyChanged("Permission");646 }647 }648 }649 }650 651 [System.Diagnostics.DebuggerStepThroughAttribute()]652 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]653 [System.Runtime.Serialization.DataContractAttribute(Name = "PluginData", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")]654 [System.SerializableAttribute()]655 public partial class PluginData : HeuristicLab.Clients.Hive.HiveItem {656 657 [System.Runtime.Serialization.OptionalFieldAttribute()]658 private byte[] DataField;659 660 [System.Runtime.Serialization.OptionalFieldAttribute()]661 private string FileNameField;662 663 [System.Runtime.Serialization.OptionalFieldAttribute()]664 private System.Guid PluginIdField;665 666 [System.Runtime.Serialization.DataMemberAttribute()]667 public byte[] Data {668 get {669 return this.DataField;670 }671 set {672 if ((object.ReferenceEquals(this.DataField, value) != true)) {673 this.DataField = value;674 this.RaisePropertyChanged("Data");675 }676 }677 }678 679 [System.Runtime.Serialization.DataMemberAttribute()]680 public string FileName {681 get {682 return this.FileNameField;683 }684 set {685 if ((object.ReferenceEquals(this.FileNameField, value) != true)) {686 this.FileNameField = value;687 this.RaisePropertyChanged("FileName");688 }689 }690 }691 692 [System.Runtime.Serialization.DataMemberAttribute()]693 public System.Guid PluginId {694 get {695 return this.PluginIdField;696 }697 set {698 if ((this.PluginIdField.Equals(value) != true)) {699 this.PluginIdField = value;700 this.RaisePropertyChanged("PluginId");701 701 } 702 702 } … … 1664 1664 public interface IHiveService { 1665 1665 1666 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GetSlaveGroup", ReplyAction = "http://tempuri.org/IHiveService/GetSlaveGroupResponse")] 1667 HeuristicLab.Clients.Hive.SlaveGroup GetSlaveGroup(System.Guid slaveGroupId); 1668 1669 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GetSlaves", ReplyAction = "http://tempuri.org/IHiveService/GetSlavesResponse")] 1670 System.Collections.Generic.List<HeuristicLab.Clients.Hive.Slave> GetSlaves(); 1671 1672 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GetSlaveGroups", ReplyAction = "http://tempuri.org/IHiveService/GetSlaveGroupsResponse")] 1673 System.Collections.Generic.List<HeuristicLab.Clients.Hive.SlaveGroup> GetSlaveGroups(); 1674 1675 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/UpdateSlave", ReplyAction = "http://tempuri.org/IHiveService/UpdateSlaveResponse")] 1676 void UpdateSlave(HeuristicLab.Clients.Hive.Slave slave); 1677 1666 1678 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/UpdateSlaveGroup", ReplyAction = "http://tempuri.org/IHiveService/UpdateSlaveGroupResponse")] 1667 1679 void UpdateSlaveGroup(HeuristicLab.Clients.Hive.SlaveGroup slaveGroup); … … 1691 1703 int GetNewHeartbeatInterval(System.Guid slaveId); 1692 1704 1693 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GrantResourcePermission", ReplyAction = "http://tempuri.org/IHiveService/GrantResourcePermissionResponse")]1694 void GrantResourcePermission(System.Guid slaveId, System.Guid grantedUserId);1695 1696 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/RevokeResourcePermission", ReplyAction = "http://tempuri.org/IHiveService/RevokeResourcePermissionResponse")]1697 void RevokeResourcePermission(System.Guid slaveId, System.Guid grantedUserId);1698 1699 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GetSlavePermissions", ReplyAction = "http://tempuri.org/IHiveService/GetSlavePermissionsResponse")]1700 System.Collections.Generic.List<HeuristicLab.Clients.Hive.ResourcePermission> GetSlavePermissions(System.Guid slaveId);1701 1702 1705 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/AddDowntime", ReplyAction = "http://tempuri.org/IHiveService/AddDowntimeResponse")] 1703 1706 System.Guid AddDowntime(HeuristicLab.Clients.Hive.Downtime downtime); … … 1717 1720 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GetUserIdByUsername", ReplyAction = "http://tempuri.org/IHiveService/GetUserIdByUsernameResponse")] 1718 1721 System.Guid GetUserIdByUsername(string username); 1722 1723 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/AuthorizesForResourceAdministration", ReplyAction = "http://tempuri.org/IHiveService/AuthorizesForResourceAdministrationResponse")] 1724 bool AuthorizesForResourceAdministration(System.Guid resourceId); 1719 1725 1720 1726 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/AddTask", ReplyAction = "http://tempuri.org/IHiveService/AddTaskResponse")] … … 1824 1830 void DeletePlugin(System.Guid pluginId); 1825 1831 1832 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GrantResourcePermissions", ReplyAction = "http://tempuri.org/IHiveService/GrantResourcePermissionsResponse")] 1833 void GrantResourcePermissions(System.Guid resourceId, System.Collections.Generic.List<System.Guid> grantedUserIds); 1834 1835 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/RevokeResourcePermissions", ReplyAction = "http://tempuri.org/IHiveService/RevokeResourcePermissionsResponse")] 1836 void RevokeResourcePermissions(System.Guid resourceId, System.Collections.Generic.List<System.Guid> grantedUserIds); 1837 1838 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GetResourcePermissions", ReplyAction = "http://tempuri.org/IHiveService/GetResourcePermissionsResponse")] 1839 System.Collections.Generic.List<HeuristicLab.Clients.Hive.ResourcePermission> GetResourcePermissions(System.Guid resourceId); 1840 1826 1841 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/AddSlave", ReplyAction = "http://tempuri.org/IHiveService/AddSlaveResponse")] 1827 1842 System.Guid AddSlave(HeuristicLab.Clients.Hive.Slave slave); … … 1832 1847 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GetSlave", ReplyAction = "http://tempuri.org/IHiveService/GetSlaveResponse")] 1833 1848 HeuristicLab.Clients.Hive.Slave GetSlave(System.Guid slaveId); 1834 1835 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GetSlaveGroup", ReplyAction = "http://tempuri.org/IHiveService/GetSlaveGroupResponse")]1836 HeuristicLab.Clients.Hive.SlaveGroup GetSlaveGroup(System.Guid slaveGroupId);1837 1838 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GetSlaves", ReplyAction = "http://tempuri.org/IHiveService/GetSlavesResponse")]1839 System.Collections.Generic.List<HeuristicLab.Clients.Hive.Slave> GetSlaves();1840 1841 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/GetSlaveGroups", ReplyAction = "http://tempuri.org/IHiveService/GetSlaveGroupsResponse")]1842 System.Collections.Generic.List<HeuristicLab.Clients.Hive.SlaveGroup> GetSlaveGroups();1843 1844 [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IHiveService/UpdateSlave", ReplyAction = "http://tempuri.org/IHiveService/UpdateSlaveResponse")]1845 void UpdateSlave(HeuristicLab.Clients.Hive.Slave slave);1846 1849 } 1847 1850 … … 1873 1876 } 1874 1877 1878 public HeuristicLab.Clients.Hive.SlaveGroup GetSlaveGroup(System.Guid slaveGroupId) { 1879 return base.Channel.GetSlaveGroup(slaveGroupId); 1880 } 1881 1882 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.Slave> GetSlaves() { 1883 return base.Channel.GetSlaves(); 1884 } 1885 1886 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.SlaveGroup> GetSlaveGroups() { 1887 return base.Channel.GetSlaveGroups(); 1888 } 1889 1890 public void UpdateSlave(HeuristicLab.Clients.Hive.Slave slave) { 1891 base.Channel.UpdateSlave(slave); 1892 } 1893 1875 1894 public void UpdateSlaveGroup(HeuristicLab.Clients.Hive.SlaveGroup slaveGroup) { 1876 1895 base.Channel.UpdateSlaveGroup(slaveGroup); … … 1909 1928 } 1910 1929 1911 public void GrantResourcePermission(System.Guid slaveId, System.Guid grantedUserId) {1912 base.Channel.GrantResourcePermission(slaveId, grantedUserId);1913 }1914 1915 public void RevokeResourcePermission(System.Guid slaveId, System.Guid grantedUserId) {1916 base.Channel.RevokeResourcePermission(slaveId, grantedUserId);1917 }1918 1919 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.ResourcePermission> GetSlavePermissions(System.Guid slaveId) {1920 return base.Channel.GetSlavePermissions(slaveId);1921 }1922 1923 1930 public System.Guid AddDowntime(HeuristicLab.Clients.Hive.Downtime downtime) { 1924 1931 return base.Channel.AddDowntime(downtime); … … 1945 1952 } 1946 1953 1954 public bool AuthorizesForResourceAdministration(System.Guid resourceId) { 1955 return base.Channel.AuthorizesForResourceAdministration(resourceId); 1956 } 1957 1947 1958 public System.Guid AddTask(HeuristicLab.Clients.Hive.Task task, HeuristicLab.Clients.Hive.TaskData taskData, System.Collections.Generic.List<System.Guid> resourceIds) { 1948 1959 return base.Channel.AddTask(task, taskData, resourceIds); … … 2085 2096 } 2086 2097 2098 public void GrantResourcePermissions(System.Guid resourceId, System.Collections.Generic.List<System.Guid> grantedUserIds) { 2099 base.Channel.GrantResourcePermissions(resourceId, grantedUserIds); 2100 } 2101 2102 public void RevokeResourcePermissions(System.Guid resourceId, System.Collections.Generic.List<System.Guid> grantedUserIds) { 2103 base.Channel.RevokeResourcePermissions(resourceId, grantedUserIds); 2104 } 2105 2106 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.ResourcePermission> GetResourcePermissions(System.Guid resourceId) { 2107 return base.Channel.GetResourcePermissions(resourceId); 2108 } 2109 2087 2110 public System.Guid AddSlave(HeuristicLab.Clients.Hive.Slave slave) { 2088 2111 return base.Channel.AddSlave(slave); … … 2096 2119 return base.Channel.GetSlave(slaveId); 2097 2120 } 2098 2099 public HeuristicLab.Clients.Hive.SlaveGroup GetSlaveGroup(System.Guid slaveGroupId) {2100 return base.Channel.GetSlaveGroup(slaveGroupId);2101 }2102 2103 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.Slave> GetSlaves() {2104 return base.Channel.GetSlaves();2105 }2106 2107 public System.Collections.Generic.List<HeuristicLab.Clients.Hive.SlaveGroup> GetSlaveGroups() {2108 return base.Channel.GetSlaveGroups();2109 }2110 2111 public void UpdateSlave(HeuristicLab.Clients.Hive.Slave slave) {2112 base.Channel.UpdateSlave(slave);2113 }2114 2121 } 2115 2122 }
Note: See TracChangeset
for help on using the changeset viewer.