Class PrincipalNotAuthorizedException
- Namespace
- MailFathom.Application.Access
- Assembly
- MailFathom.Application.dll
The failure raised when a use case is reached by a principal that was not granted it.
public sealed class PrincipalNotAuthorizedException : MailFathomException, ISerializable
- Inheritance
-
PrincipalNotAuthorizedException
- Implements
- Inherited Members
Remarks
It travels as an application failure rather than as a status code or a protocol result, because the same refusal has to reach two boundaries that answer it differently: the MCP surface says nothing a caller can tell from a tool that does not exist, and the administrative surface names the permission that would have sufficed. A use case that raised either shape directly would have decided both.
One failure covers a caller whose grant omits the permission, work admitted under the wrong kind of principal, and a use case reached under no principal at all. The message separates them for an operator reading a log; nothing else does, and a boundary reports RequiredPermission rather than parsing prose.
The message names a published permission, a kind of principal, or neither, and never the identity the work was admitted under. That identity is MailFathom's own name for a configured key, but for a token it is the issuer and subject the deployment authorized — a host name and a remote party's identifier for a person — and the message rule on MailFathomException admits neither. A boundary that has to name the caller reads Identity and decides for itself what its own readers may see.
Properties
- ErrorCode
Gets the stable code identifying this failure to a boundary that must report it without naming a type.
- RequiredPermission
Gets the permission that would have sufficed, unspecified when the refusal was about the kind of principal rather than about a grant.