Changeset 7045
- Timestamp:
- 11/22/11 18:13:48 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Services.Hive/3.3/HiveService.cs
r6983 r7045 87 87 authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client, HiveRoles.Slave); 88 88 author.AuthorizeForTask(taskId, Permission.Read); 89 return dao.GetTask(taskId); 89 90 return trans.UseTransaction(() => { 91 return dao.GetTask(taskId); 92 }, false, false); 90 93 } 91 94 … … 100 103 public IEnumerable<LightweightTask> GetLightweightTasks(IEnumerable<Guid> taskIds) { 101 104 authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); 102 var tasks = dao.GetTasks(x => taskIds.Contains(x.TaskId)).Select(x => new LightweightTask(x)).ToArray(); 103 foreach (var task in tasks) 104 author.AuthorizeForTask(task.Id, Permission.Read); 105 return tasks; 105 106 return trans.UseTransaction(() => { 107 var tasks = dao.GetTasks(x => taskIds.Contains(x.TaskId)).Select(x => new LightweightTask(x)).ToArray(); 108 foreach (var task in tasks) 109 author.AuthorizeForTask(task.Id, Permission.Read); 110 return tasks; 111 }, false, false); 106 112 } 107 113 108 114 public IEnumerable<LightweightTask> GetLightweightChildTasks(Guid? parentTaskId, bool recursive, bool includeParent) { 109 115 authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); 110 var tasks = GetChildTasks(parentTaskId, recursive, includeParent).Select(x => new LightweightTask(x)).ToArray(); 111 foreach (var task in tasks) 112 author.AuthorizeForTask(task.Id, Permission.Read); 113 return tasks; 116 117 return trans.UseTransaction(() => { 118 var tasks = GetChildTasks(parentTaskId, recursive, includeParent).Select(x => new LightweightTask(x)).ToArray(); 119 foreach (var task in tasks) 120 author.AuthorizeForTask(task.Id, Permission.Read); 121 return tasks; 122 }, false, false); 114 123 } 115 124 … … 117 126 authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client); 118 127 author.AuthorizeForJob(jobId, Permission.Read); 119 return dao.GetTasks(x => x.JobId == jobId).Select(x => new LightweightTask(x)).ToArray(); 128 129 return trans.UseTransaction(() => { 130 return dao.GetTasks(x => x.JobId == jobId).Select(x => new LightweightTask(x)).ToArray(); 131 }, false, false); 120 132 } 121 133
Note: See TracChangeset
for help on using the changeset viewer.