Changeset 12963
- Timestamp:
- 09/21/15 16:35:55 (9 years ago)
- Location:
- stable
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 12926-12927,12959
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Hive.Administrator/3.3/HiveRoles.cs
r12009 r12963 28 28 public const string User = "Hive User"; 29 29 public const string Slave = "Hive Slave"; 30 public const string IsAllowedPrivileged = "Hive IsAllowedPrivileged";31 30 32 31 public static bool CheckAdminUserPermissions() { -
stable/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.Designer.cs
r12009 r12963 70 70 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 71 71 this.refreshButton = new System.Windows.Forms.Button(); 72 this.isPrivilegedCheckBox = new System.Windows.Forms.CheckBox();73 72 this.UnloadButton = new System.Windows.Forms.Button(); 74 73 this.refreshAutomaticallyCheckBox = new System.Windows.Forms.CheckBox(); … … 332 331 this.resourceNamesTextBox.Location = new System.Drawing.Point(70, 52); 333 332 this.resourceNamesTextBox.Name = "resourceNamesTextBox"; 334 this.resourceNamesTextBox.Size = new System.Drawing.Size( 385, 20);333 this.resourceNamesTextBox.Size = new System.Drawing.Size(471, 20); 335 334 this.resourceNamesTextBox.TabIndex = 2; 336 335 this.resourceNamesTextBox.Validated += new System.EventHandler(this.resourceNamesTextBox_Validated); … … 365 364 this.refreshButton.UseVisualStyleBackColor = true; 366 365 this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click); 367 //368 // isPrivilegedCheckBox369 //370 this.isPrivilegedCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));371 this.isPrivilegedCheckBox.AutoSize = true;372 this.isPrivilegedCheckBox.Location = new System.Drawing.Point(491, 54);373 this.isPrivilegedCheckBox.Name = "isPrivilegedCheckBox";374 this.isPrivilegedCheckBox.Size = new System.Drawing.Size(72, 17);375 this.isPrivilegedCheckBox.TabIndex = 3;376 this.isPrivilegedCheckBox.Text = "Privileged";377 this.toolTip.SetToolTip(this.isPrivilegedCheckBox, "If checked, the task will be executed in a privileged sandbox on the slave.");378 this.isPrivilegedCheckBox.UseVisualStyleBackColor = true;379 this.isPrivilegedCheckBox.CheckedChanged += new System.EventHandler(this.isPrivilegedCheckBox_CheckChanged);380 366 // 381 367 // UnloadButton … … 475 461 this.searchButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 476 462 this.searchButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Zoom; 477 this.searchButton.Location = new System.Drawing.Point( 461, 50);463 this.searchButton.Location = new System.Drawing.Point(547, 50); 478 464 this.searchButton.Name = "searchButton"; 479 465 this.searchButton.Size = new System.Drawing.Size(24, 24); … … 487 473 this.Controls.Add(this.UnloadButton); 488 474 this.Controls.Add(this.searchButton); 489 this.Controls.Add(this.isPrivilegedCheckBox);490 475 this.Controls.Add(this.infoGroupBox); 491 476 this.Controls.Add(this.refreshAutomaticallyCheckBox); … … 542 527 private System.Windows.Forms.Label calculatingLabel; 543 528 private System.Windows.Forms.Label jobsLabel; 544 private System.Windows.Forms.CheckBox isPrivilegedCheckBox;545 529 private System.Windows.Forms.TabPage stateTabPage; 546 530 private HeuristicLab.MainForm.WindowsForms.ViewHost stateLogViewHost; -
stable/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
r12009 r12963 119 119 executionTimeTextBox.Text = string.Empty; 120 120 resourceNamesTextBox.Text = string.Empty; 121 isPrivilegedCheckBox.Checked = false;122 121 refreshAutomaticallyCheckBox.Checked = false; 123 122 lock (runCollectionViewLocker) { … … 132 131 executionTimeTextBox.Text = Content.ExecutionTime.ToString(); 133 132 resourceNamesTextBox.Text = Content.Job.ResourceNames; 134 isPrivilegedCheckBox.Checked = Content.Job.IsPrivileged;135 133 refreshAutomaticallyCheckBox.Checked = Content.RefreshAutomatically; 136 134 logView.Content = Content.Log; … … 163 161 searchButton.Enabled = !Locked; 164 162 jobsTreeView.Enabled = !Locked; 165 isPrivilegedCheckBox.Enabled = !Locked;166 163 refreshAutomaticallyCheckBox.Enabled = !Locked; 167 164 refreshButton.Enabled = !Locked; … … 191 188 this.jobsTreeView.ReadOnly = !Content.IsControllable || Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded || Content.IsProgressing; 192 189 193 this.isPrivilegedCheckBox.Enabled = HiveClient.Instance.IsAllowedPrivileged && Content.IsControllable && !(Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded) && !Content.IsProgressing;194 190 this.refreshAutomaticallyCheckBox.Enabled = Content.IsControllable && alreadyUploaded && jobsLoaded && Content.ExecutionState == ExecutionState.Started && !Content.IsProgressing; 195 191 this.refreshButton.Enabled = Content.IsDownloadable && alreadyUploaded && !Content.IsProgressing; … … 279 275 lock (runCollectionViewLocker) { 280 276 runCollectionViewHost.Content = GetAllRunsFromJob(Content); 281 }282 if (InvokeRequired) {283 Invoke(new Action(() => { isPrivilegedCheckBox.Checked = Content.Job.IsPrivileged; }));284 } else {285 isPrivilegedCheckBox.Checked = Content.Job.IsPrivileged;286 277 } 287 278 } … … 423 414 } 424 415 425 private void isPrivilegedCheckBox_CheckChanged(object sender, EventArgs e) {426 if (Content != null && !SuppressEvents) Content.Job.IsPrivileged = isPrivilegedCheckBox.Checked;427 }428 429 416 private void refreshButton_Click(object sender, EventArgs e) { 430 417 var invoker = new Action<RefreshableJob>(HiveClient.LoadJob); -
stable/HeuristicLab.Clients.Hive.Slave/3.3/SlaveTask.cs
r12009 r12963 105 105 106 106 private AppDomain CreateAppDomain(Task task, String pluginDir, string configFileName) { 107 if (task.IsPrivileged) { 108 appDomain = SandboxManager.CreateAndInitPrivilegedSandbox(task.Id.ToString(), pluginDir, Path.Combine(pluginDir, configFileName)); 109 } else { 110 appDomain = SandboxManager.CreateAndInitSandbox(task.Id.ToString(), pluginDir, Path.Combine(pluginDir, configFileName)); 111 } 107 appDomain = SandboxManager.CreateAndInitSandbox(task.Id.ToString(), pluginDir, Path.Combine(pluginDir, configFileName)); 112 108 appDomain.UnhandledException += new UnhandledExceptionEventHandler(AppDomain_UnhandledException); 113 109 -
stable/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r12665 r12963 68 68 set { alreadyUploadedPlugins = value; } 69 69 } 70 71 private bool isAllowedPrivileged;72 public bool IsAllowedPrivileged {73 get { return isAllowedPrivileged; }74 set { isAllowedPrivileged = value; }75 }76 70 #endregion 77 71 … … 99 93 100 94 try { 101 IsAllowedPrivileged = HiveServiceLocator.Instance.CallHiveService((s) => s.IsAllowedPrivileged());102 103 95 jobs = new HiveItemCollection<RefreshableJob>(); 104 96 var jobsLoaded = HiveServiceLocator.Instance.CallHiveService<IEnumerable<Job>>(s => s.GetJobs()); … … 275 267 refreshableJob.Progress.Status = "Uploading Job..."; 276 268 refreshableJob.Job.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddJob(refreshableJob.Job)); 277 bool isPrivileged = refreshableJob.Job.IsPrivileged;278 269 refreshableJob.Job = HiveServiceLocator.Instance.CallHiveService((s) => s.GetJob(refreshableJob.Job.Id)); // update owner and permissions 279 refreshableJob.Job.IsPrivileged = isPrivileged;280 270 cancellationToken.ThrowIfCancellationRequested(); 281 271 … … 298 288 foreach (HiveTask hiveTask in refreshableJob.HiveTasks) { 299 289 var task = TS.Task.Factory.StartNew((hj) => { 300 UploadTaskWithChildren(refreshableJob.Progress, (HiveTask)hj, null, resourceIds, jobCount, totalJobCount, configFilePlugin.Id, refreshableJob.Job.Id, refreshableJob.Log, refreshableJob.Job.IsPrivileged,cancellationToken);290 UploadTaskWithChildren(refreshableJob.Progress, (HiveTask)hj, null, resourceIds, jobCount, totalJobCount, configFilePlugin.Id, refreshableJob.Job.Id, refreshableJob.Log, cancellationToken); 301 291 }, hiveTask); 302 292 task.ContinueWith((x) => refreshableJob.Log.LogException(x.Exception), TaskContinuationOptions.OnlyOnFaulted); … … 343 333 /// </summary> 344 334 /// <param name="parentHiveTask">shall be null if its the root task</param> 345 private void UploadTaskWithChildren(IProgress progress, HiveTask hiveTask, HiveTask parentHiveTask, IEnumerable<Guid> groups, int[] taskCount, int totalJobCount, Guid configPluginId, Guid jobId, ILog log, bool isPrivileged,CancellationToken cancellationToken) {335 private void UploadTaskWithChildren(IProgress progress, HiveTask hiveTask, HiveTask parentHiveTask, IEnumerable<Guid> groups, int[] taskCount, int totalJobCount, Guid configPluginId, Guid jobId, ILog log, CancellationToken cancellationToken) { 346 336 taskUploadSemaphore.WaitOne(); 347 337 bool semaphoreReleased = false; … … 375 365 hiveTask.Task.PluginsNeededIds.Add(configPluginId); 376 366 hiveTask.Task.JobId = jobId; 377 hiveTask.Task.IsPrivileged = isPrivileged;378 367 379 368 log.LogMessage(string.Format("Uploading task ({0} kb, {1} objects)", taskData.Data.Count() / 1024, hiveTask.ItemTask.GetObjectGraphObjects().Count())); … … 398 387 var task = TS.Task.Factory.StartNew((tuple) => { 399 388 var arguments = (Tuple<HiveTask, HiveTask>)tuple; 400 UploadTaskWithChildren(progress, arguments.Item1, arguments.Item2, groups, taskCount, totalJobCount, configPluginId, jobId, log, isPrivileged,cancellationToken);389 UploadTaskWithChildren(progress, arguments.Item1, arguments.Item2, groups, taskCount, totalJobCount, configPluginId, jobId, log, cancellationToken); 401 390 }, new Tuple<HiveTask, HiveTask>(child, hiveTask)); 402 391 task.ContinueWith((x) => log.LogException(x.Exception), TaskContinuationOptions.OnlyOnFaulted); … … 442 431 IDictionary<Guid, HiveTask> allHiveTasks = downloader.Results; 443 432 var parents = allHiveTasks.Values.Where(x => !x.Task.ParentTaskId.HasValue); 444 refreshableJob.Job.IsPrivileged = allHiveTasks.Any(x => x.Value.Task.IsPrivileged);445 433 446 434 refreshableJob.Progress.Status = "Downloading/deserializing complete. Displaying tasks..."; -
stable/HeuristicLab.Clients.Hive/3.3/ServiceClients/HiveServiceClient.cs
r9219 r12963 351 351 352 352 [System.Runtime.Serialization.OptionalFieldAttribute()] 353 private bool IsPrivilegedField;354 355 [System.Runtime.Serialization.OptionalFieldAttribute()]356 353 private System.Guid JobIdField; 357 354 … … 415 412 this.IsParentTaskField = value; 416 413 this.RaisePropertyChanged("IsParentTask"); 417 }418 }419 }420 421 [System.Runtime.Serialization.DataMemberAttribute()]422 public bool IsPrivileged423 {424 get425 {426 return this.IsPrivilegedField;427 }428 set429 {430 if ((this.IsPrivilegedField.Equals(value) != true))431 {432 this.IsPrivilegedField = value;433 this.RaisePropertyChanged("IsPrivileged");434 414 } 435 415 } … … 2553 2533 System.Collections.Generic.List<HeuristicLab.Clients.Hive.JobPermission> GetJobPermissions(System.Guid jobId); 2554 2534 2555 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/IsAllowedPrivileged", ReplyAction="http://tempuri.org/IHiveService/IsAllowedPrivilegedResponse")]2556 bool IsAllowedPrivileged();2557 2558 2535 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/Hello", ReplyAction="http://tempuri.org/IHiveService/HelloResponse")] 2559 2536 void Hello(HeuristicLab.Clients.Hive.Slave slave); … … 2882 2859 } 2883 2860 2884 public bool IsAllowedPrivileged()2885 {2886 return base.Channel.IsAllowedPrivileged();2887 }2888 2889 2861 public void Hello(HeuristicLab.Clients.Hive.Slave slave) 2890 2862 { -
stable/HeuristicLab.Clients.Hive/3.3/ServiceClients/Job.cs
r12009 r12963 27 27 public partial class Job : IDeepCloneable, IContent { 28 28 29 private bool isPrivileged;30 public bool IsPrivileged {31 get { return isPrivileged; }32 set { isPrivileged = value; }33 }34 35 29 #region Constructors and Cloning 36 30 public Job() { … … 48 42 this.Description = original.Description; 49 43 this.Id = original.Id; 50 this.IsPrivileged = original.IsPrivileged;51 44 this.Permission = original.Permission; 52 45 } -
stable/HeuristicLab.Clients.Hive/3.3/ServiceClients/Task.cs
r12009 r12963 43 43 this.FinishWhenChildJobsFinished = original.FinishWhenChildJobsFinished; 44 44 this.JobId = original.JobId; 45 this.IsPrivileged = original.IsPrivileged;46 45 } 47 46 -
stable/HeuristicLab.PluginInfrastructure/3.3/Sandboxing/SandboxManager.cs
r12009 r12963 25 25 using System.Security.Permissions; 26 26 using HeuristicLab.PluginInfrastructure.Manager; 27 using System.IO;28 27 29 28 namespace HeuristicLab.PluginInfrastructure.Sandboxing { 30 29 public static class SandboxManager { 31 32 30 /// <summary> 33 /// Creates an privileged sandbox, meaning that the executed code is fully trusted and permissions are not restricted. 34 /// This method is a fall back for trusted users in HeuristicLab Hive. 31 /// Returns a new AppDomain with loaded assemblies/plugins from applicationBase 35 32 /// </summary> 36 public static AppDomain CreateAndInit PrivilegedSandbox(string appDomainName, string applicationBase, string configFilePath) {33 public static AppDomain CreateAndInitSandbox(string appDomainName, string applicationBase, string configFilePath) { 37 34 PermissionSet pSet; 38 35 pSet = new PermissionSet(PermissionState.Unrestricted); … … 53 50 return applicationDomain; 54 51 } 55 56 /// <summary>57 /// Creates a sandbox with restricted permissions.58 /// Code that is executed in such an AppDomain is partially-trusted and is not allowed to call or override59 /// methods that require full trust.60 /// </summary>61 public static AppDomain CreateAndInitSandbox(string appDomainName, string applicationBase, string configFilePath) {62 PermissionSet pSet;63 64 pSet = new PermissionSet(PermissionState.None);65 pSet.AddPermission(new SecurityPermission(PermissionState.None));66 pSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution));67 pSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.Infrastructure));68 pSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.UnmanagedCode));69 pSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.SerializationFormatter));70 //needed for HeuristicLab.Persistence, see DynamicMethod Constructor (String, Type, array<Type []()>[], Type, Boolean)71 pSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.ControlEvidence));72 pSet.AddPermission(new ReflectionPermission(PermissionState.Unrestricted));73 74 FileIOPermission ioPerm = new FileIOPermission(PermissionState.None);75 //allow path discovery for system drive, needed by HeuristicLab.Persistence: Serializer.BuildTypeCache() -> Assembly.CodeBase76 ioPerm.AddPathList(FileIOPermissionAccess.PathDiscovery, Path.GetPathRoot(Path.GetFullPath(Environment.SystemDirectory)));77 //allow full access to the appdomain's base directory78 ioPerm.AddPathList(FileIOPermissionAccess.AllAccess, applicationBase);79 pSet.AddPermission(ioPerm);80 81 AppDomainSetup setup = new AppDomainSetup();82 setup.PrivateBinPath = applicationBase;83 setup.ApplicationBase = applicationBase;84 setup.ConfigurationFile = configFilePath;85 86 Type applicationManagerType = typeof(SandboxApplicationManager);87 AppDomain applicationDomain = AppDomain.CreateDomain(appDomainName, null, setup, pSet, null);88 SandboxApplicationManager applicationManager = (SandboxApplicationManager)applicationDomain.CreateInstanceAndUnwrap(applicationManagerType.Assembly.FullName, applicationManagerType.FullName, true, BindingFlags.NonPublic | BindingFlags.Instance, null, null, null, null);89 90 PluginManager pm = new PluginManager(applicationBase);91 pm.DiscoverAndCheckPlugins();92 applicationManager.PrepareApplicationDomain(pm.Applications, pm.Plugins);93 94 return applicationDomain;95 }96 52 } 97 53 } -
stable/HeuristicLab.Services.Hive
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Services.Hive merged: 12926,12959
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.Hive.DataAccess
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Services.Hive.DataAccess merged: 12926
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml
r12962 r12963 76 76 <Column Name="Command" Type="global::HeuristicLab.Services.Hive.DataAccess.Command?" DbType="VarChar(30)" CanBeNull="true" /> 77 77 <Column Name="JobId" Storage="_HiveExperimentId" Type="System.Guid" DbType="UniqueIdentifier NOT NULL" CanBeNull="false" /> 78 <Column Name="IsPrivileged" Type="System.Boolean" DbType="Bit" CanBeNull="false" />79 78 <Association Name="Task_AssignedResource" Member="AssignedResources" ThisKey="TaskId" OtherKey="TaskId" Type="AssignedResource" /> 80 79 <Association Name="Task_RequiredPlugin" Member="RequiredPlugins" ThisKey="TaskId" OtherKey="TaskId" Type="RequiredPlugin" /> -
stable/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout
r12962 r12963 27 27 </nestedChildShapes> 28 28 </classShape> 29 <classShape Id="695bfc39-59f3-4e60-8644-f847964bf62c" absoluteBounds="6.5, 1, 2, 3. 3093082682291666">29 <classShape Id="695bfc39-59f3-4e60-8644-f847964bf62c" absoluteBounds="6.5, 1, 2, 3.1170068359374996"> 30 30 <DataClassMoniker Name="/HiveDataContext/Task" /> 31 31 <nestedChildShapes> 32 <elementListCompartment Id="a6a30e11-03d1-4869-82e6-b733f4ef9974" absoluteBounds="6.5150000000000006, 1.46, 1.9700000000000002, 2. 7493082682291665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />32 <elementListCompartment Id="a6a30e11-03d1-4869-82e6-b733f4ef9974" absoluteBounds="6.5150000000000006, 1.46, 1.9700000000000002, 2.5570068359375" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" /> 33 33 </nestedChildShapes> 34 34 </classShape> … … 141 141 </nodes> 142 142 </associationConnector> 143 <associationConnector edgePoints="[(8. 0192961430407 : 3.90397379557292); (8.0192961430407 : 5.04807657877604); (8.875 : 5.04807657877604)]" fixedFrom="NotFixed" fixedTo="NotFixed">143 <associationConnector edgePoints="[(8.5 : 4.1170068359375); (8.875 : 4.5)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 144 144 <AssociationMoniker Name="/HiveDataContext/Task/Task_AssignedResource" /> 145 145 <nodes> … … 148 148 </nodes> 149 149 </associationConnector> 150 <associationConnector edgePoints="[(7. 20145120722822 : 3.90397379557292); (7.20145120722822: 5.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">150 <associationConnector edgePoints="[(7.4687475 : 4.1170068359375); (7.4687475 : 5.875)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 151 151 <AssociationMoniker Name="/HiveDataContext/Task/Task_RequiredPlugin" /> 152 152 <nodes> … … 176 176 </nodes> 177 177 </associationConnector> 178 <associationConnector edgePoints="[(6.125 : 3. 46715413411458); (6.5 : 3.46715413411458)]" fixedFrom="NotFixed" fixedTo="NotFixed">178 <associationConnector edgePoints="[(6.125 : 3.37100341796875); (6.5 : 3.37100341796875)]" fixedFrom="NotFixed" fixedTo="NotFixed"> 179 179 <AssociationMoniker Name="/HiveDataContext/Job/Job_Task" /> 180 180 <nodes> -
stable/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs
r12962 r12963 1620 1620 private System.Guid _HiveExperimentId; 1621 1621 1622 private bool _IsPrivileged;1623 1624 1622 private EntitySet<AssignedResource> _AssignedResources; 1625 1623 … … 1664 1662 partial void OnJobIdChanging(System.Guid value); 1665 1663 partial void OnJobIdChanged(); 1666 partial void OnIsPrivilegedChanging(bool value);1667 partial void OnIsPrivilegedChanged();1668 1664 #endregion 1669 1665 … … 1924 1920 this.SendPropertyChanged("JobId"); 1925 1921 this.OnJobIdChanged(); 1926 }1927 }1928 }1929 1930 [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsPrivileged", DbType="Bit")]1931 public bool IsPrivileged1932 {1933 get1934 {1935 return this._IsPrivileged;1936 }1937 set1938 {1939 if ((this._IsPrivileged != value))1940 {1941 this.OnIsPrivilegedChanging(value);1942 this.SendPropertyChanging();1943 this._IsPrivileged = value;1944 this.SendPropertyChanged("IsPrivileged");1945 this.OnIsPrivilegedChanged();1946 1922 } 1947 1923 } -
stable/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Initialize Hive Database.sql
r12962 r12963 86 86 [Command] VarChar(30), 87 87 [JobId] UniqueIdentifier NOT NULL, 88 [IsPrivileged] Bit NOT NULL,89 88 CONSTRAINT [PK_dbo.Task] PRIMARY KEY ([TaskId]) 90 89 ) -
stable/HeuristicLab.Services.Hive.DataAccess/3.3/SQL Scripts/Prepare Hive Database.sql
r12962 r12963 113 113 CREATE NONCLUSTERED INDEX [TaskJobIdIndex] 114 114 ON [dbo].[Task] ([JobId]) 115 INCLUDE ([TaskId],[TaskState],[ExecutionTimeMs],[LastHeartbeat],[ParentTaskId],[Priority],[CoresNeeded],[MemoryNeeded],[IsParentTask],[FinishWhenChildJobsFinished],[Command] ,[IsPrivileged])115 INCLUDE ([TaskId],[TaskState],[ExecutionTimeMs],[LastHeartbeat],[ParentTaskId],[Priority],[CoresNeeded],[MemoryNeeded],[IsParentTask],[FinishWhenChildJobsFinished],[Command]) 116 116 GO 117 117 … … 119 119 CREATE NONCLUSTERED INDEX [TaskGetWaitingTasksIndex] 120 120 ON [dbo].[Task] ([TaskState],[IsParentTask],[FinishWhenChildJobsFinished],[CoresNeeded],[MemoryNeeded]) 121 INCLUDE ([TaskId],[ExecutionTimeMs],[LastHeartbeat],[ParentTaskId],[Priority],[Command],[JobId] ,[IsPrivileged])121 INCLUDE ([TaskId],[ExecutionTimeMs],[LastHeartbeat],[ParentTaskId],[Priority],[Command],[JobId]) 122 122 GO 123 123 -
stable/HeuristicLab.Services.Hive/3.3/Converter.cs
r12962 r12963 44 44 Command = source.Command.ToDto(), 45 45 JobId = source.JobId, 46 IsPrivileged = source.IsPrivileged,47 46 PluginsNeededIds = source.RequiredPlugins.Select(x => x.PluginId).ToList(), 48 47 StateLog = source.StateLogs.Select(x => x.ToDto()).OrderBy(x => x.DateTime).ToList(), 49 LastTaskDataUpdate = source.JobData == null ? DateTime.MinValue : source.JobData.LastUpdate 48 LastTaskDataUpdate = source.JobData == null ? DateTime.MinValue : source.JobData.LastUpdate, 49 IsPrivileged = true 50 50 }; 51 51 } … … 72 72 target.Command = source.Command.ToEntity(); 73 73 target.JobId = source.JobId; 74 target.IsPrivileged = source.IsPrivileged;75 74 var ids = target.RequiredPlugins.Select(x => x.PluginId); 76 75 target.RequiredPlugins.AddRange(source.PluginsNeededIds -
stable/HeuristicLab.Services.Hive/3.3/DataTransfer/Task.cs
r12009 r12963 44 44 [DataMember] 45 45 public Guid JobId { get; set; } 46 // BackwardsCompatibility3.3 47 #region Backwards compatible code, remove with 3.4 46 48 [DataMember] 47 49 public bool IsPrivileged { get; set; } 50 #endregion 48 51 49 52 public Task() { 50 this.PluginsNeededIds = new List<Guid>(); 53 PluginsNeededIds = new List<Guid>(); 54 IsPrivileged = true; 51 55 } 52 56 } -
stable/HeuristicLab.Services.Hive/3.3/HiveRoles.cs
r12009 r12963 25 25 public const string Slave = "Hive Slave"; 26 26 public const string Client = "Hive User"; 27 public const string IsAllowedPrivileged = "Hive IsAllowedPrivileged";28 27 } 29 28 } -
stable/HeuristicLab.Services.Hive/3.3/HiveService.cs
r12962 r12963 469 469 } 470 470 471 // BackwardsCompatibility3.3 472 #region Backwards compatible code, remove with 3.4 471 473 public bool IsAllowedPrivileged() { 472 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);473 return RoleVerifier.IsInRole(HiveRoles.IsAllowedPrivileged);474 }474 return true; 475 } 476 #endregion 475 477 #endregion 476 478 -
stable/HeuristicLab.Services.Hive/3.3/ServiceContracts/IHiveService.cs
r12962 r12963 97 97 IEnumerable<JobPermission> GetJobPermissions(Guid jobId); 98 98 99 // BackwardsCompatibility3.3 100 #region Backwards compatible code, remove with 3.4 99 101 [OperationContract] 100 102 bool IsAllowedPrivileged(); // current user may execute privileged task 103 #endregion 101 104 #endregion 102 105
Note: See TracChangeset
for help on using the changeset viewer.