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