Table of Contents

Method TryParse

Namespace
MailFathom.Domain.Access
Assembly
MailFathom.Domain.dll

TryParse(string?, out MailFathomPermission)

Parses an operator-supplied or token-supplied permission name.

public static bool TryParse(string? name, out MailFathomPermission permission)

Parameters

name string

The written name.

permission MailFathomPermission

The parsed permission when the name is published; otherwise the unspecified default.

Returns

bool

true when the name is one this repository publishes; otherwise false.

Remarks

The comparison is exact and neither trimmed nor case-folded, because the same string has to travel as an OAuth scope token, where a scope is compared byte for byte. Accepting a spelling here that an authorization server would treat as a different scope is how a grant comes to mean one thing in configuration and another in a token.