/// <summary> /// Initializes a new instance of the <see cref="SecurityRol"/> class. /// Parses the mainNode into actions and menu items. /// </summary> /// <param name="name">The name.</param> /// <param name="mainNode">The main node.</param> public SecurityRol(string name, XmlNode mainNode) { Name = name; var actionNodes = mainNode.SelectNodes("actions/action[@enabled='true']"); if (actionNodes != null) { foreach (XmlNode actionNode in actionNodes) { if (actionNode.NodeType != XmlNodeType.Element) { //skip break; } var action = new AllowedAction { Controller = actionNode.Attributes["controller"].Value, Action = actionNode.Attributes["action"].Value, }; _actions.Add(action); } } }
/// <summary> /// Initializes a new instance of the <see cref="SecurityRol"/> class. /// Parses the mainNode into actions and menu items. /// </summary> /// <param name="name">The name.</param> /// <param name="mainNode">The main node.</param> public SecurityRol(string name, XmlNode mainNode) { Name = name; var actionNodes = mainNode.SelectNodes("actions/action[@enabled='true']"); if (actionNodes != null) { foreach (XmlNode actionNode in actionNodes) { if (actionNode.NodeType != XmlNodeType.Element) { //skip break; } var action = new AllowedAction { Controller = actionNode.Attributes["controller"].Value, Action = actionNode.Attributes["action"].Value, }; _actions.Add(action); } } }