internal static IList <ValidationRule> GetApplicableValidationRules(string cmdletFullName, IList <string> parameters, ValidationRuleSkus applicableSku)
        {
            IList <RoleEntryValidationRuleTuple> applicableRules = RBACValidationRulesList.Instance.GetApplicableRules(cmdletFullName, parameters, applicableSku);
            List <ValidationRule> list = new List <ValidationRule>(applicableRules.Count);

            foreach (RoleEntryValidationRuleTuple roleEntryValidationRuleTuple in applicableRules)
            {
                list.Add(ValidationRuleFactory.Create(roleEntryValidationRuleTuple.RuleDefinition, roleEntryValidationRuleTuple.MatchingRoleEntry));
            }
            return(list);
        }
 internal static IList <ValidationRule> GetApplicableValidationRules(string cmdletFullName, IList <string> parameters, ADRawEntry currentExecutingUser)
 {
     if (currentExecutingUser == null)
     {
         throw new ArgumentNullException("currentExecutingUser");
     }
     if (string.IsNullOrEmpty(cmdletFullName))
     {
         throw new ArgumentNullException("cmdletFullName");
     }
     return(ValidationRuleFactory.GetApplicableValidationRules(cmdletFullName, parameters, ValidationRuleFactory.GetValidationRuleSkuForUser(currentExecutingUser)));
 }
        internal static List <ValidationRule> GetValidationRulesByFeature(string feature)
        {
            if (string.IsNullOrEmpty(feature))
            {
                throw new ArgumentNullException("feature");
            }
            IList <ValidationRuleDefinition> applicableRules = RBACValidationRulesList.Instance.GetApplicableRules(feature);
            List <ValidationRule>            list            = new List <ValidationRule>(applicableRules.Count);

            foreach (ValidationRuleDefinition definition in applicableRules)
            {
                list.Add(ValidationRuleFactory.Create(definition, null));
            }
            return(list);
        }