Changeset 12484 for branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi
- Timestamp:
- 06/19/15 18:06:19 (10 years ago)
- Location:
- branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/DataController.cs
r12477 r12484 41 41 get { return ServiceLocator.Instance.UserManager; } 42 42 } 43 private IRoleVerifier RoleVerifier { 44 get { return ServiceLocator.Instance.RoleVerifier; } 45 } 46 private IAuthorizationManager AuthorizationManager { 47 get { return ServiceLocator.Instance.AuthorizationManager; } 48 } 43 49 44 50 public IEnumerable<DTO.Job> GetJobs() { … … 47 53 48 54 public IEnumerable<DTO.Job> GetJobsByUserId(Guid id) { 55 if (id != UserManager.CurrentUserId) { 56 RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator); 57 } 49 58 using (var pm = PersistenceManager) { 50 59 return pm.UseTransaction(() => { … … 62 71 using (var pm = PersistenceManager) { 63 72 return pm.UseTransaction(() => { 73 var dimJobDao = pm.JobDao; 64 74 var factTaskDao = pm.FactTaskDao; 75 var job = dimJobDao.GetById(id); 76 if (job != null && job.OwnerUserId != UserManager.CurrentUserId) { 77 RoleVerifier.AuthenticateForAllRoles(HiveRoles.Administrator); 78 } 65 79 return factTaskDao.GetByJobId(id).Select(x => new DTO.Task { 66 TotalRuntime = x.TotalRuntime, 67 TotalWaitingTime = x.TotalWaitingTime, 68 TotalTransferTime = x.TotalTransferTime, 80 Id = x.TaskId, 81 CalculatingTime = x.CalculatingTime, 82 WaitingTime = x.WaitingTime, 83 TransferTime = x.TransferTime, 84 InitialWaitingTime = x.InitialWaitingTime, 69 85 NumCalculationRuns = x.NumCalculationRuns, 70 86 NumRetries = x.NumRetries, … … 72 88 MemoryRequired = x.MemoryRequired, 73 89 Priority = x.Priority, 90 State = x.TaskState.ToString(), 74 91 LastClientId = x.LastClientId, 75 92 StartTime = x.StartTime, 76 EndTime = x.EndTime 93 EndTime = x.EndTime, 94 Exception = x.Exception 77 95 }).ToList(); 78 96 }); -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApi/DataTransfer/Task.cs
r12477 r12484 24 24 namespace HeuristicLab.Services.WebApp.Statistics.WebApi.DataTransfer { 25 25 public class Task { 26 public double TotalRuntime { get; set; } 27 public double TotalWaitingTime { get; set; } 28 public double TotalTransferTime { get; set; } 26 public Guid Id { get; set; } 27 public double CalculatingTime { get; set; } 28 public double WaitingTime { get; set; } 29 public double TransferTime { get; set; } 30 public double InitialWaitingTime { get; set; } 29 31 public int NumCalculationRuns { get; set; } 30 32 public int NumRetries { get; set; } … … 32 34 public int MemoryRequired { get; set; } 33 35 public int Priority { get; set; } 36 public string State { get; set; } 34 37 public Guid? LastClientId { get; set; } 35 public DateTime StartTime { get; set; }38 public DateTime? StartTime { get; set; } 36 39 public DateTime? EndTime { get; set; } 40 public string Exception { get; set; } 37 41 } 38 42 }
Note: See TracChangeset
for help on using the changeset viewer.