public static Parse ( string sddl ) : IList |
||
sddl | string | |
Résultat | IList |
/// <summary> /// Extracts the access rules from the SDDL string. /// </summary> private static void ParseSddl(string url, string sddl, List <HttpAccessRule> accessRules) { IList <AccessControlEntity> entities = AccessControlEntity.Parse(sddl); for (int ii = 0; ii < entities.Count; ii++) { AccessControlEntity entity = entities[ii]; if (entity.AccessType != "A") { continue; } ApplicationAccessRight rights = ApplicationAccessRight.None; switch (entity.Rights) { case "GA": case "GXGW": case "GWGX": { rights = ApplicationAccessRight.Configure; break; } case "GX": { rights = ApplicationAccessRight.Run; break; } } if (rights == ApplicationAccessRight.None) { continue; } string accountName = ApplicationAccessRule.SidToAccountName(entity.AccountSid); if (String.IsNullOrEmpty(accountName)) { continue; } HttpAccessRule rule = new HttpAccessRule(); rule.UrlPrefix = url; rule.Right = rights; rule.IdentityName = accountName; accessRules.Add(rule); } }
/// <summary> /// Extracts the access rules from the SDDL string. /// </summary> private static void ParseSddl(string url, string sddl, List <HttpAccessRule> accessRules) { IList <AccessControlEntity> entities = AccessControlEntity.Parse(sddl); for (int ii = 0; ii < entities.Count; ii++) { AccessControlEntity entity = entities[ii]; if (entity.AccessType != "A") { continue; } ApplicationAccessRight rights = ApplicationAccessRight.None; switch (entity.Rights) { case "GA": case "GXGW": case "GWGX": { rights = ApplicationAccessRight.Configure; break; } case "GX": { rights = ApplicationAccessRight.Run; break; } } if (rights == ApplicationAccessRight.None) { continue; } } }