Class ForbiddenError

Namespace
REslava.Result
Assembly
REslava.Result.dll

Represents an authorization error (HTTP 403 equivalent). Use when the caller is authenticated but lacks permission.

public class ForbiddenError : Reason<ForbiddenError>, IError, IReason
Inheritance
ForbiddenError
Implements
Inherited Members
Extension Methods

Examples

Result<User>.Fail(new ForbiddenError());
Result<User>.Fail(new ForbiddenError("Admin role required"));
Result<User>.Fail(new ForbiddenError("Delete", "Order"));

Constructors

ForbiddenError()

public ForbiddenError()

ForbiddenError(string)

public ForbiddenError(string message)

Parameters

message string

ForbiddenError(string, string)

public ForbiddenError(string action, string resource)

Parameters

action string
resource string

Methods

CreateNew(string, ImmutableDictionary<string, object>)

Factory method for creating new instances (maintains immutability). Must be implemented by derived classes.

protected override ForbiddenError CreateNew(string message, ImmutableDictionary<string, object> tags)

Parameters

message string
tags ImmutableDictionary<string, object>

Returns

ForbiddenError