/// <summary> /// Ruft die ACEs der User ab und speichert sie /// </summary> public void FillAllAuthorizedUserACE() { //Prüft ob die ACEs schon gefüllt sind if (ACEs == null) { FillACEs(); } AllAuthorizedACE = new DirectoryACE("-"); AllAuthorizedACE.Member = new List <DirectoryACE>(DirectoryStructure.GetAllAuthorizedUser(ACEs)); List <DirectoryACE> AllAces = new List <DirectoryACE>(); foreach (var ace in AllAuthorizedACE.Member) { AllAces.Add(ace); if (ace.Member != null) { foreach (var ace2 in ace.Member) { AllAces.Add(ace2); if (ace2.Member != null) { AllAces.AddRange(ace2.Member); } } } } var grpList = AllAces.GroupBy(u => u.SID).ToList(); foreach (var ace in AllAuthorizedACE.Member) { IGrouping <string, DirectoryACE> match = grpList.FirstOrDefault(a => a.Key == ace.SID); ace.rightCount = match.Count(); if (ace.Member != null) { foreach (var ace2 in ace.Member) { IGrouping <string, DirectoryACE> match2 = grpList.FirstOrDefault(a => a.Key == ace2.SID); ace2.rightCount = match2.Count(); if (ace2.Member != null) { foreach (var ace3 in ace2.Member) { IGrouping <string, DirectoryACE> match3 = grpList.FirstOrDefault(a => a.Key == ace3.SID); ace3.rightCount = match3.Count(); } } } } } }
/// <summary> /// Klappt das Verzeichnis auf und findet alle Kinder /// </summary> private void Expand() { // Item hat keine Kinder und kann daher nicht aufgeklappt werden if (CanExpand == false) { return; } // Finde alle Kinder List <DirectoryItem> children = (Item.Type == DirectoryItemType.Server) ? DirectoryStructure.GetChildren(Item.FullPath) : DirectoryStructure.GetChildren(Item.Id); Children = new ObservableCollection <DirectoryItemViewModel>( children.Select(c => new DirectoryItemViewModel(c, eventAggregator))); }
/// <summary> /// Ruft die ACEs ab und speichert sie im ACEs Property /// </summary> public void FillACEs() { ACEs = new List <DirectoryACE>(DirectoryStructure.GetACEs(Item.Id)); }