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); }
public static void SetRule(DependencyObject target, AuthorizationRule value) { target.SetValue(Authorization.RuleProperty, value); }
public static AuthorizationResult Authorize(object target, AuthorizationRule rule) { AuthorizationRuleManager.AddAuthorizationRule(target, rule); return(Authorization.Authorize(target)); }