Пример #1
0
 public static void ClearAuthorizationRules(object target)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     AuthorizationRuleManager.GetRules(target).Clear();
 }
Пример #2
0
 public static IEnumerable <AuthorizationRule> GetAuthorizationRules(object target)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     return(AuthorizationRuleManager.GetRules(target).ToArray());
 }
Пример #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));
 }
Пример #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);
 }