Skip to content
ModularityKit.Mutator ModularityKit.Mutator Docs
  • Home
  • Core
  • Governance
  • Redis
  • API
Search Results for

    Show / Hide Table of Contents

    Class PolicyDecision

    Represents the decision of a policy regarding a mutation. Contains approval, denial, modification instructions, and metadata.

    Inheritance
    object
    PolicyDecision
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: ModularityKit.Mutator.Abstractions.Policies
    Assembly: ModularityKit.Mutator.dll
    Syntax
    public sealed class PolicyDecision

    Properties

    | Edit this page View Source

    IsAllowed

    Indicates whether the mutation is allowed.

    Declaration
    public bool IsAllowed { get; init; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Metadata

    Additional metadata for diagnostics or logging.

    Declaration
    public IReadOnlyDictionary<string, object>? Metadata { get; init; }
    Property Value
    Type Description
    IReadOnlyDictionary<string, object>
    | Edit this page View Source

    Modifications

    Modifications to apply if the policy alters the mutation.

    Declaration
    public IReadOnlyDictionary<string, object>? Modifications { get; init; }
    Property Value
    Type Description
    IReadOnlyDictionary<string, object>
    | Edit this page View Source

    PolicyName

    Name of the policy that made this decision.

    Declaration
    public string? PolicyName { get; init; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Reason

    Reason for the decision (human-readable).

    Declaration
    public string? Reason { get; init; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Requirements

    Requirements that must be fulfilled (e.g., approvals) for the mutation.

    Declaration
    public IReadOnlyList<PolicyRequirement>? Requirements { get; init; }
    Property Value
    Type Description
    IReadOnlyList<PolicyRequirement>
    | Edit this page View Source

    Severity

    Severity of the decision (Info, Warning, Error, Critical).

    Declaration
    public PolicyDecisionSeverity Severity { get; init; }
    Property Value
    Type Description
    PolicyDecisionSeverity
    | Edit this page View Source

    Timestamp

    Timestamp when the decision was made.

    Declaration
    public DateTimeOffset Timestamp { get; init; }
    Property Value
    Type Description
    DateTimeOffset

    Methods

    | Edit this page View Source

    Allow(string?, string?)

    Creates an allow decision.

    Declaration
    public static PolicyDecision Allow(string? policyName = null, string? reason = null)
    Parameters
    Type Name Description
    string policyName

    Optional policy name.

    string reason

    Optional human-readable reason.

    Returns
    Type Description
    PolicyDecision

    A policy decision that allows the mutation.

    | Edit this page View Source

    Deny(string, string?)

    Creates a deny decision with standard error severity.

    Declaration
    public static PolicyDecision Deny(string reason, string? policyName = null)
    Parameters
    Type Name Description
    string reason

    Reason for denial.

    string policyName

    Optional policy name.

    Returns
    Type Description
    PolicyDecision

    A policy decision that denies the mutation.

    | Edit this page View Source

    DenyCritical(string, string?)

    Creates a deny decision with critical severity.

    Declaration
    public static PolicyDecision DenyCritical(string reason, string? policyName = null)
    Parameters
    Type Name Description
    string reason

    Reason for denial.

    string policyName

    Optional policy name.

    Returns
    Type Description
    PolicyDecision

    A critical denial policy decision.

    | Edit this page View Source

    Modify(IReadOnlyDictionary<string, object>, string?)

    Creates a modification decision that adjusts mutation values.

    Declaration
    public static PolicyDecision Modify(IReadOnlyDictionary<string, object> modifications, string? policyName = null)
    Parameters
    Type Name Description
    IReadOnlyDictionary<string, object> modifications

    Dictionary of modifications to apply.

    string policyName

    Optional policy name.

    Returns
    Type Description
    PolicyDecision

    A policy decision that modifies the mutation.

    | Edit this page View Source

    RequireApproval(PolicyRequirement, string?)

    Creates a decision that requires additional approval before proceeding.

    Declaration
    public static PolicyDecision RequireApproval(PolicyRequirement requirement, string? policyName = null)
    Parameters
    Type Name Description
    PolicyRequirement requirement

    The requirement that must be fulfilled.

    string policyName

    Optional policy name.

    Returns
    Type Description
    PolicyDecision

    A policy decision requiring approval.

    • Edit this page
    • View Source
    In this article
    ModularityKit.Mutator Generated from XML docs and published from main. Back to top