Changeset 4423 for branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ClientFacade.cs
- Timestamp:
- 09/17/10 10:26:55 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ClientFacade.cs
r4368 r4423 62 62 public Response RequestSnapshot(Guid jobId) { 63 63 using (contextFactory.GetContext()) { 64 ServiceLocator.GetAuthorizationManager().Authorize ForJobs(jobId);64 ServiceLocator.GetAuthorizationManager().AuthorizeJobs(jobId); 65 65 return jobManager.RequestSnapshot(jobId); 66 66 } … … 71 71 public ResponseObject<SerializedJob> GetLastSerializedResult(Guid jobId) { 72 72 using (contextFactory.GetContext(false)) { 73 ServiceLocator.GetAuthorizationManager().Authorize ForJobs(jobId);73 ServiceLocator.GetAuthorizationManager().AuthorizeJobs(jobId); 74 74 return jobManager.GetLastSerializedResult(jobId); 75 75 } … … 80 80 public ResponseObject<SerializedJob> GetSnapshotResult(Guid jobId) { 81 81 using (contextFactory.GetContext(false)) { 82 ServiceLocator.GetAuthorizationManager().Authorize ForJobs(jobId);82 ServiceLocator.GetAuthorizationManager().AuthorizeJobs(jobId); 83 83 return jobManager.GetSnapshotResult(jobId); 84 84 } … … 89 89 public ResponseObject<JobDto> GetJobById(Guid jobId) { 90 90 using (contextFactory.GetContext(false)) { 91 ServiceLocator.GetAuthorizationManager().Authorize ForJobs(jobId);91 ServiceLocator.GetAuthorizationManager().AuthorizeJobs(jobId); 92 92 return jobManager.GetJobById(jobId); 93 93 } … … 98 98 public Response AbortJob(Guid jobId) { 99 99 using (contextFactory.GetContext()) { 100 ServiceLocator.GetAuthorizationManager().Authorize ForJobs(jobId);100 ServiceLocator.GetAuthorizationManager().AuthorizeJobs(jobId); 101 101 return jobManager.AbortJob(jobId); 102 102 } … … 107 107 public ResponseObject<JobResultList> GetJobResults(IEnumerable<Guid> jobIds) { 108 108 using (contextFactory.GetContext(false)) { 109 ServiceLocator.GetAuthorizationManager().Authorize ForJobs(jobIds.ToArray());109 ServiceLocator.GetAuthorizationManager().AuthorizeJobs(jobIds.ToArray()); 110 110 return jobManager.GetJobResults(jobIds); 111 111 } … … 117 117 using (contextFactory.GetContext(false)) { 118 118 if (parentJobId.HasValue) { 119 ServiceLocator.GetAuthorizationManager().Authorize ForJobs(parentJobId.Value);119 ServiceLocator.GetAuthorizationManager().AuthorizeJobs(parentJobId.Value); 120 120 } 121 121 // If parentJobId is null, GetChildJobResults will filter the results for the current user … … 123 123 } 124 124 } 125 126 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 127 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Client)] 128 public ResponseObject<HiveExperimentDtoList> GetHiveExperiments() { 129 using (contextFactory.GetContext(false)) { 130 return jobManager.GetHiveExperiments(); 131 } 132 } 133 134 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 135 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Client)] 136 public ResponseObject<HiveExperimentDto> UpdateHiveExperiment(HiveExperimentDto hiveExperimentDto) { 137 using (contextFactory.GetContext()) { 138 if (hiveExperimentDto.UserId == Guid.Empty) { 139 hiveExperimentDto.UserId = ServiceLocator.GetAuthorizationManager().UserId; 140 } else { 141 ServiceLocator.GetAuthorizationManager().Authorize(hiveExperimentDto.UserId); 142 } 143 return jobManager.UpdateHiveExperiment(hiveExperimentDto); 144 } 145 } 146 147 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 148 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Client)] 149 public Response DeleteHiveExperiment(Guid hiveExperimentId) { 150 using (contextFactory.GetContext()) { 151 var hiveExperimentDto = DaoLocator.HiveExperimentDao.FindById(hiveExperimentId); 152 if (hiveExperimentDto != null) { 153 ServiceLocator.GetAuthorizationManager().Authorize(hiveExperimentDto.UserId); 154 } 155 return jobManager.DeleteHiveExperiment(hiveExperimentId); 156 } 157 } 158 159 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)] 160 [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Client)] 161 public ResponseObject<JobDto> AddChildJob(Guid parentJobId, SerializedJob serializedJob) { 162 using (contextFactory.GetContext()) { 163 ServiceLocator.GetAuthorizationManager().AuthorizeJobs(parentJobId); 164 return jobManager.AddChildJob(parentJobId, serializedJob); 165 } 166 } 125 167 #endregion 126 127 128 168 } 129 169 }
Note: See TracChangeset
for help on using the changeset viewer.