// IConfigurationPersistent Members /// <summary> /// Persists column configuration to config node. [grid] subnode will be created under specified node pr reused if one already exists /// </summary> public void PersistConfiguration(ConfigSectionNode node) { if (node == null) { return; } ConfigSectionNode gnode = findSubNodeForThisGrid(node) as ConfigSectionNode; //see if node for this grid already exists if (gnode != null) //delete with all column defs that are different now { gnode.Delete(); } gnode = node.AddChildNode(CONFIG_GRID_SECTION); if (!string.IsNullOrEmpty(m_ID)) { gnode.AddAttributeNode(CONFIG_ID_ATTR, ID); } foreach (var col in m_Columns) { col.PersistConfiguration(gnode); } }
private static void redactAclLevel(ConfigSectionNode level, bool cascadePub) { //1 Check visibility var visibility = level.Of(ACL_LEVEL_VISIBILITY_ATTRIBUTE).ValueAsEnum(cascadePub ? AclLevelVisibility.PubCascade : AclLevelVisibility.None); if (visibility == AclLevelVisibility.None) { level.Delete(); return; } //2 Process this level var effectiveAccessLevel = level.Of(ACL_LEVEL_OVERRIDE_ATTRIBUTE, AccessLevel.CONFIG_LEVEL_ATTR).ValueAsInt(0); level.DeleteAllAttributes(); if (effectiveAccessLevel > 0) { level.AddAttributeNode(AccessLevel.CONFIG_LEVEL_ATTR, effectiveAccessLevel); } //3 Loop through all child nodes foreach (var child in level.Children) { redactAclLevel(child, visibility == AclLevelVisibility.PubCascade); } }