/// <summary> /// Generates hierarchical values for the <see cref="RightsDecl.Level"/> field /// for all rules. This value represents which rule is more specified when /// merging two rule in order to prioritize rights. /// </summary> /// <param name="root">The root element of the hierarchy tree.</param> /// <param name="level">The base level for the root element.</param> private static void BuildLevel(RightsDecl root, int level = 0) { root.Level = level; if (root is RightsRule rootRule) { foreach (var child in rootRule.Children) { BuildLevel(child, level + RuleLevelSize); } } }
public void MergeGroups(RightsDecl include) { DeclAdd = include.DeclAdd.Except(DeclDeny).Concat(DeclAdd).Distinct().ToArray(); }