- Timestamp:
- 06/21/12 18:02:33 (13 years ago)
- Location:
- branches/GP-MoveOperators
- Files:
-
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-MoveOperators
- Property svn:ignore
-
old new 20 20 bin 21 21 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/GP-MoveOperators/HeuristicLab.Services.Hive/3.3/Manager/AuthorizationManager.cs
r7259 r8085 34 34 35 35 public void AuthorizeForTask(Guid taskId, DT.Permission requiredPermission) { 36 if (ServiceLocator.Instance. AuthenticationManager.IsInRole(HiveRoles.Slave)) return; // slave-users can access all tasks36 if (ServiceLocator.Instance.RoleVerifier.IsInRole(HiveRoles.Slave)) return; // slave-users can access all tasks 37 37 38 38 Permission permission = ServiceLocator.Instance.HiveDao.GetPermissionForTask(taskId, ServiceLocator.Instance.UserManager.CurrentUserId); … … 46 46 throw new SecurityException("Current user is not authorized to access task"); 47 47 } 48 49 public void AuthorizeForResourceAdministration(Guid resourceId) { 50 Resource resource = DT.Convert.ToEntity(ServiceLocator.Instance.HiveDao.GetResource(resourceId)); 51 if (resource.OwnerUserId != ServiceLocator.Instance.UserManager.CurrentUserId && !ServiceLocator.Instance.RoleVerifier.IsInRole(HiveRoles.Administrator)) 52 throw new SecurityException("Current user is not authorized to access resource"); 53 } 48 54 } 49 55 } -
branches/GP-MoveOperators/HeuristicLab.Services.Hive/3.3/Manager/EventManager.cs
r7434 r8085 49 49 SetTimeoutSlavesOffline(); 50 50 SetTimeoutTasksWaiting(); 51 DeleteObsoleteSlaves(); 51 52 }, true); 52 53 … … 116 117 } 117 118 } 119 120 /// <summary> 121 /// Searches for slaves that are disposable and deletes them if they were offline for too long 122 /// </summary> 123 private void DeleteObsoleteSlaves() { 124 var slaves = dao.GetSlaves(x => x.IsDisposable.GetValueOrDefault() && x.SlaveState == SlaveState.Offline && (DateTime.Now - x.LastHeartbeat) > HeuristicLab.Services.Hive.Properties.Settings.Default.SweepInterval); 125 foreach (DT.Slave slave in slaves) dao.DeleteSlave(slave.Id); 126 } 118 127 } 119 128 }
Note: See TracChangeset
for help on using the changeset viewer.