Method CallerActingFor
- Namespace
- MailFathom.Application.Access
- Assembly
- MailFathom.Application.dll
CallerActingFor(UserId, string, IEnumerable<MailFathomPermission>)
Describes a caller the transport admitted that acts for one user's mail.
public static AuthorizedPrincipal CallerActingFor(UserId user, string identity, IEnumerable<MailFathomPermission> grantedPermissions)
Parameters
userUserIdThe user whose mail the caller was admitted to act on.
identitystringWhat the transport admitted the caller as, in the forms Identity describes.
grantedPermissionsIEnumerable<MailFathomPermission>The permissions the entry that admitted it resolved to, empty when it granted none.
Returns
- AuthorizedPrincipal
The principal the use cases the caller reaches are consulted with.
Remarks
This is the caller every mail-reading surface admits. The user is decided by whatever admitted the caller and is carried rather than chosen, so no argument of any tool can move it: a request cannot name a user, and a grant however broad cannot widen the mail it reaches beyond that user's own.
Exceptions
- ArgumentNullException
Thrown when
identityorgrantedPermissionsis null.- ArgumentException
Thrown when
identityis empty or white space, or whenusernames nobody.
CallerActingFor(UserId, string, ScopedGrant)
Describes a caller the transport admitted that acts for one user's mail, holding each permission at the scopes it was granted at.
public static AuthorizedPrincipal CallerActingFor(UserId user, string identity, ScopedGrant grant)
Parameters
userUserIdThe user whose mail the caller was admitted to act on.
identitystringWhat the transport admitted the caller as, in the forms Identity describes.
grantScopedGrantWhat the caller holds: the user's grant, narrowed by whatever admitted the caller.
Returns
- AuthorizedPrincipal
The principal the use cases the caller reaches are consulted with.
Exceptions
- ArgumentNullException
Thrown when
identityorgrantis null.- ArgumentException
Thrown when
identityis empty or white space, or whenusernames nobody.