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