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.Administrator/3.3/Views/ResourcesView.cs

    r15576 r15658  
    302302
    303303      var mainResources = new HashSet<Resource>(resources.OfType<SlaveGroup>().Where(x => x.ParentResourceId == null));
    304       var subResources = new HashSet<Resource>(resources.Except(mainResources));
     304      var parentedMainResources = new HashSet<Resource>(resources.OfType<SlaveGroup>()
     305        .Where(x => x.ParentResourceId.HasValue && !resources.Select(y => y.Id).Contains(x.ParentResourceId.Value)));
     306      mainResources.UnionWith(parentedMainResources);
     307      var subResources = new HashSet<Resource>(resources.Except(mainResources).OrderByDescending(x => x.Name));
    305308
    306309      var stack = new Stack<Resource>(mainResources.OrderByDescending(x => x.Name));
    307       var top = stack.Peek();
     310      Resource top = null;
    308311
    309312      TreeNode currentNode = null;
     
    311314
    312315      while(stack.Any()) {
     316        if (top == null) top = stack.Peek();
    313317        var newResource = stack.Pop();
    314318        var newNode = new TreeNode(newResource.Name) { Tag = newResource };
Note: See TracChangeset for help on using the changeset viewer.