Ignore:
Timestamp:
01/26/18 08:51:30 (3 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)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/HiveAdminClient.cs

    r15576 r15658  
    2424using HeuristicLab.Common;
    2525using HeuristicLab.Core;
     26using System.Collections.Generic;
    2627
    2728namespace HeuristicLab.Clients.Hive {
     
    3637    }
    3738
     39    #region Properties
    3840    private IItemList<Resource> resources;
    3941    public IItemList<Resource> Resources {
     
    6264    }
    6365
     66    #endregion
     67
    6468    #region Events
    6569    public event EventHandler Refreshing;
     
    8690
    8791        HiveServiceLocator.Instance.CallHiveService(service => {
    88           service.GetSlaveGroups().ForEach(g => resources.Add(g));
    89           service.GetSlaves().ForEach(s => resources.Add(s));
     92          service.GetSlaveGroupsForAdministration().ForEach(g => resources.Add(g));
     93          service.GetSlavesForAdministration().ForEach(s => resources.Add(s));
    9094          service.GetProjectsForAdministration().ForEach(p => projects.Add(p));
    9195        });
     
    174178      }
    175179    }
     180
     181    #region
     182    public bool CheckAccessToAdminAreaGranted() {
     183      if(projects != null) {
     184        return projects.Count > 0;
     185      } else {
     186        bool accessGranted = false;
     187        HiveServiceLocator.Instance.CallHiveService(s => {
     188          accessGranted = s.CheckAccessToAdminAreaGranted();
     189        });
     190        return accessGranted;
     191      }
     192    }
     193    #endregion
    176194  }
    177195}
Note: See TracChangeset for help on using the changeset viewer.