public static bool IsMicrosoftUser(this PolicyAnalysisContext context, CachedUser user) { if (context.UserLinks.LinkByGitHubLogin.ContainsKey(user.Login)) { return(true); } var microsoftBotsTeam = user.Org.GetMicrosoftBotsTeam(); return(microsoftBotsTeam != null && microsoftBotsTeam.Members.Contains(user)); }
public abstract IEnumerable <PolicyViolation> GetViolations(PolicyAnalysisContext context);
public static IReadOnlyList <PolicyViolation> Run(PolicyAnalysisContext context, IEnumerable <PolicyRule> rules) { return(rules.SelectMany(r => r.GetViolations(context)).ToArray()); }
public static IReadOnlyList <PolicyViolation> Run(PolicyAnalysisContext context) { var rules = GetRules(); return(Run(context, rules)); }