private async Task CreateSubBranches() { if (group == null) { return; } foreach (var perm in group.PermissionsEnumerable()) { TreeBranch branch; if (perm.IsGroup) { //WE are a group, so get our subgroup var g2 = await group.Engine.GetGroupAsync(perm); if (g2 == null) { //We dont have a group, create a regular branch branch = new TreeBranch(this, perm); } else { //We have a subgrou branch = new TreeBranch(this, perm, g2); await branch.CreateSubBranches(); } } else { branch = new TreeBranch(this, perm); } children.Add(branch); } }
public static async Task <TreeBranch> CreateTreeAsync(Group entry) { TreeBranch tree = new TreeBranch(entry); await tree.CreateSubBranches(); return(tree); }
private TreeBranch(TreeBranch parent, Permission perm, Group group) { this.parent = parent; this.group = group; this.permission = perm; }
private TreeBranch(Group group) { this.parent = null; this.group = group; this.permission = Permission.FromGroup(group, StateType.Unset); }
private TreeBranch(TreeBranch parent, Permission perm) { this.parent = parent; this.permission = perm; this.group = null; }
public TreeBranch() { parent = null; }