Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/26/18 08:51:30 (7 years ago)
Author:
jzenisek
Message:

#2839

  • worked on (restricted) accessibility of hive's administration area for non-admin roles
  • adapted HiveClient & HiveAdminClient entity loading (client- & service-side)
Location:
branches/HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs

    r15642 r15658  
    468468    private static IEnumerable<Resource> GetAssignedResourcesForProject(Guid projectId) {
    469469      var assignedProjectResources = HiveServiceLocator.Instance.CallHiveService(s => s.GetAssignedResourcesForProject(projectId));
    470       return HiveAdminClient.Instance.Resources.Where(x => assignedProjectResources.Select(y => y.ResourceId).Contains(x.Id));
     470      return HiveClient.Instance.Resources.Where(x => assignedProjectResources.Select(y => y.ResourceId).Contains(x.Id));
    471471    }
    472472
    473473    private static IEnumerable<Resource> GetAssignedResourcesForJob(Guid jobId) {
    474474      var assignedJobResources = HiveServiceLocator.Instance.CallHiveService(s => s.GetAssignedResourcesForJob(jobId));
    475       return HiveAdminClient.Instance.Resources.Where(x => assignedJobResources.Select(y => y.ResourceId).Contains(x.Id));
     475      return HiveClient.Instance.Resources.Where(x => assignedJobResources.Select(y => y.ResourceId).Contains(x.Id));
    476476    }
    477477
     
    581581      resourceAncestors.Clear();
    582582      resourceDescendants.Clear();
    583       var resources = HiveAdminClient.Instance.Resources;
     583      var resources = HiveClient.Instance.Resources;
    584584
    585585      foreach (var r in resources) {
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.cs

    r15642 r15658  
    8080    #region Overrides
    8181    protected override void OnLoad(EventArgs e) {
    82       HiveAdminClient.Instance.Refreshing += HiveAdminClient_Instance_Refreshing;
    83       HiveAdminClient.Instance.Refreshed += HiveAdminClient_Instance_Refreshed;
     82      HiveClient.Instance.Refreshing += HiveClient_Instance_Refreshing;
     83      HiveClient.Instance.Refreshed += HiveClient_Instance_Refreshed;
    8484      base.OnLoad(e);
    8585    }
    8686
    8787    protected override void OnClosing(CancelEventArgs e) {
    88       HiveAdminClient.Instance.Refreshed -= HiveAdminClient_Instance_Refreshed;
    89       HiveAdminClient.Instance.Refreshing -= HiveAdminClient_Instance_Refreshing;
     88      HiveClient.Instance.Refreshed -= HiveClient_Instance_Refreshed;
     89      HiveClient.Instance.Refreshing -= HiveClient_Instance_Refreshing;
    9090      base.OnClosing(e);
    9191    }
     
    9393
    9494    #region Event Handlers
    95     private void HiveAdminClient_Instance_Refreshing(object sender, EventArgs e) {
    96       if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveAdminClient_Instance_Refreshing, sender, e);
     95    private void HiveClient_Instance_Refreshing(object sender, EventArgs e) {
     96      if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveClient_Instance_Refreshing, sender, e);
    9797      else {
    9898        var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>();
     
    102102    }
    103103
    104     private void HiveAdminClient_Instance_Refreshed(object sender, EventArgs e) {
    105       if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveAdminClient_Instance_Refreshed, sender, e);
     104    private void HiveClient_Instance_Refreshed(object sender, EventArgs e) {
     105      if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveClient_Instance_Refreshed, sender, e);
    106106      else {
    107107        var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>();
     
    129129
    130130      await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
    131         action: () => UpdateProjects(),
     131        action: () => UpdateInstance(),
    132132        finallyCallback: () => updatingProjects = false);
    133133    }
     
    151151
    152152    #region Helpers
     153    private void UpdateInstance() {
     154      HiveClient.Instance.Refresh();
     155    }
     156
    153157    private void UpdateProjects() {
    154       HiveAdminClient.Instance.Refresh();
     158      HiveClient.Instance.RefreshProjectsAndResources();
    155159      hiveResourceSelector.JobId = jobId;
    156160      hiveResourceSelector.ProjectId = projectId;
Note: See TracChangeset for help on using the changeset viewer.