Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/27/10 08:35:43 (14 years ago)
Author:
cneumuel
Message:

added authorizationManager which checks for permission to specific jobs (#1168)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/SlaveFacade.cs

    r4305 r4333  
    7777    public ResponseResultReceived StoreFinishedJobResult(Guid slaveId, Guid jobId, byte[] result, double percentage, string exception) {
    7878      using (contextFactory.GetContext()) {
     79        ServiceLocator.GetAuthorizationManager().AuthorizeForJobs(jobId);
    7980        return slaveCommunicator.StoreFinishedJobResult(slaveId, jobId, result, percentage, exception);
    8081      }
     
    9394    public Response IsJobStillNeeded(Guid jobId) {
    9495      using (contextFactory.GetContext()) {
    95         return slaveCommunicator.IsJobStillNeeded(jobId);
     96        ServiceLocator.GetAuthorizationManager().AuthorizeForJobs(jobId);
     97        return slaveCommunicator.IsJobStillNeeded(jobId);
    9698      }
    9799    }
     
    100102    [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Slave)]
    101103    public ResponseList<CachedHivePluginInfoDto> GetPlugins(List<HivePluginInfoDto> pluginList) {
    102       return slaveCommunicator.GetPlugins(pluginList);     
     104      return slaveCommunicator.GetPlugins(pluginList);
    103105    }
    104106
     
    107109    public ResponseResultReceived ProcessSnapshot(Guid slaveId, Guid jobId, byte[] result, double percentage, string exception) {
    108110      using (contextFactory.GetContext()) {
    109         return slaveCommunicator.ProcessSnapshot(slaveId, jobId, result, percentage, exception);
     111        ServiceLocator.GetAuthorizationManager().AuthorizeForJobs(jobId);
     112        return slaveCommunicator.ProcessSnapshot(slaveId, jobId, result, percentage, exception);
    110113      }
    111114    }
     
    115118    public ResponseCalendar GetCalendar(Guid slaveId) {
    116119      using (contextFactory.GetContext()) {
    117         return slaveCommunicator.GetCalendar(slaveId); 
     120        return slaveCommunicator.GetCalendar(slaveId);
    118121      }
    119122    }
     
    121124    [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Administrator)]
    122125    [PrincipalPermission(SecurityAction.Demand, Role = HiveRoles.Slave)]
    123     public Response SetCalendarStatus(Guid slaveId, CalendarState state) { 
     126    public Response SetCalendarStatus(Guid slaveId, CalendarState state) {
    124127      using (contextFactory.GetContext()) {
    125128        return slaveCommunicator.SetCalendarStatus(slaveId, state);
     
    137140    public Stream GetStreamedJob(Guid slaveId) {
    138141      using (contextFactory.GetContext(false)) {
     142        ResponseObject<JobDto> job = null;
    139143        MultiStream stream = new MultiStream();
    140 
    141         ResponseObject<JobDto> job = null;
    142 
    143144        job = ServiceLocator.GetSlaveCommunicator().GetJob(slaveId);
    144145
     
    183184    public ResponseResultReceived ProcessSnapshotStreamed(Stream stream) {
    184185      using (contextFactory.GetContext()) {
    185         return ((IInternalSlaveCommunicator)slaveCommunicator).ProcessJobResult(stream, false); 
     186        return ((IInternalSlaveCommunicator)slaveCommunicator).ProcessJobResult(stream, false);
    186187      }
    187188    }
Note: See TracChangeset for help on using the changeset viewer.