public static FromRegString ( string str ) : |
||
str | string | |
return |
public static List <GroupAuthzRule> GetAuthzRules() { List <GroupAuthzRule> rules = new List <GroupAuthzRule>(); string[] strRules = Settings.Store.GroupAuthzRules; foreach (string str in strRules) { GroupAuthzRule rule = GroupAuthzRule.FromRegString(str); if (rule != null) { rules.Add(rule); } // else // Log error //m_logger.ErrorFormat("Unrecognized registry entry when loading authorization rule, ignoring: {0}", str); } return(rules); }
public static string SaveAuthzRules(List <GroupAuthzRule> rules) { string ret = ""; List <string> strList = new List <string>(); foreach (GroupRule rule in rules) { if (GroupAuthzRule.FromRegString(rule.ToRegString()) == null) { ret += rule + "\n"; m_logger.ErrorFormat("Rule doesn't comply:{0}", rule); } else { strList.Add(rule.ToRegString()); } } Settings.Store.GroupAuthzRules = strList.ToArray(); return(ret); }