/// <summary> /// Конструктор /// </summary> /// <param name="rules">Простые правила безопасности</param> public ComplexRule(ISecurityRule[] rules) { this.rules = rules; this.supportedObjectTypes = null; }
#pragma warning disable 1591 // Xml Comments public void AddRule(ISecurityRule rule) { _rules.Add(rule); }
/// <summary> /// Add an instance of an <see cref="ISecurityRule"/> that was unable to be evaluted because it encountered an exception /// </summary> /// <param name="rule">The instance of the <see cref="ISecurityRule"/> that could not be evaluted.</param> /// <param name="exception">The exception that prevented the <see cref="ISecurityRule"/> from being evaluated.</param> public void AddErrorRule(ISecurityRule rule, Exception exception) { _rulesThatCausedError.Add(new RuleEvaluationError(rule, exception)); }
/// <summary> /// Instantiates an instance of <see cref="RuleEvaluationError"/> /// </summary> /// <param name="rule"><see cref="ISecurityRule"/> that encounted the error when evaluating.</param> /// <param name="error">The error that was encountered</param> public RuleEvaluationError(ISecurityRule rule, Exception error) { Error = error; Rule = rule; }
/// <summary> /// Add an instance of an <see cref="ISecurityRule"/> that was broken during Authorization /// </summary> /// <param name="rule">An instance of a broken <see cref="ISecurityRule"/></param> public void AddBrokenRule(ISecurityRule rule) { _brokenRules.Add(rule); }
#pragma warning disable 1591 // Xml Comments public void AddRule(ISecurityRule rule) { _rules.Add(rule); }
/// <summary> /// Instantiates an instance of <see cref="RuleEvaluationError"/> /// </summary> /// <param name="rule"><see cref="ISecurityRule"/> that encounted the error when evaluating.</param> /// <param name="error">The error that was encountered</param> public RuleEvaluationError(ISecurityRule rule, Exception error) { Error = error; Rule = rule; }
/// <summary> /// Add an instance of an <see cref="ISecurityRule"/> that was unable to be evaluted because it encountered an exception /// </summary> /// <param name="rule">The instance of the <see cref="ISecurityRule"/> that could not be evaluted.</param> /// <param name="exception">The exception that prevented the <see cref="ISecurityRule"/> from being evaluated.</param> public void AddErrorRule(ISecurityRule rule, Exception exception) { _rulesThatCausedError.Add(new RuleEvaluationError(rule,exception)); }
/// <summary> /// Add an instance of an <see cref="ISecurityRule"/> that was broken during Authorization /// </summary> /// <param name="rule">An instance of a broken <see cref="ISecurityRule"/></param> public void AddBrokenRule(ISecurityRule rule) { _brokenRules.Add(rule); }