Exemple #1
0
 public static void ClearAuthorizationRules(object target)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     AuthorizationRuleManager.GetRules(target).Clear();
 }
Exemple #2
0
 public static IEnumerable <AuthorizationRule> GetAuthorizationRules(object target)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     return(AuthorizationRuleManager.GetRules(target).ToArray());
 }
Exemple #3
0
 public static bool RemoveAuthorizationRule(object target, AuthorizationRule rule)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     if (rule == null)
     {
         throw new ArgumentNullException("rule");
     }
     return(AuthorizationRuleManager.GetRules(target).Remove(rule));
 }
Exemple #4
0
 public static void AddAuthorizationRule(object target, AuthorizationRule rule)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     if (rule == null)
     {
         throw new ArgumentNullException("rule");
     }
     AuthorizationRuleManager.GetRules(target).Add(rule);
 }