Exemplo n.º 1
0
        private IEnumerable <LocalUserPrincipalModel> GetPrincipalHierarchy(LocalUserPrincipalModel principal)
        {
            IEnumerable <LocalUserPrincipalModel> result = new LocalUserPrincipalModel[] { principal };

            foreach (LocalUserGroupMemberModel member in principal.UserGroupMemberships)
            {
                result = result.Concat(GetPrincipalHierarchy(member.Group.Principal));
            }

            return(result);
        }