Example #1
0
        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));
        }
Example #2
0
 public abstract IEnumerable <PolicyViolation> GetViolations(PolicyAnalysisContext context);
Example #3
0
 public static IReadOnlyList <PolicyViolation> Run(PolicyAnalysisContext context, IEnumerable <PolicyRule> rules)
 {
     return(rules.SelectMany(r => r.GetViolations(context)).ToArray());
 }
Example #4
0
        public static IReadOnlyList <PolicyViolation> Run(PolicyAnalysisContext context)
        {
            var rules = GetRules();

            return(Run(context, rules));
        }