Table of Contents

Method TryCreate

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

TryCreate(IEnumerable<string>, out RolePermissions?, out IReadOnlyList<string>)

Builds the list a role is written with from the entries somebody wrote.

public static bool TryCreate(IEnumerable<string> entries, out RolePermissions? permissions, out IReadOnlyList<string> unpublished)

Parameters

entries IEnumerable<string>

The written entries: published names and patterns.

permissions RolePermissions

The list when every entry grants something; otherwise null.

unpublished IReadOnlyList<string>

The written entries that grant nothing, in ordinal order, which is what a refusal names: a name nothing publishes, and a pattern reaching nothing published.

Returns

bool

true when every entry grants something; otherwise false.

Remarks

A name is compared exactly, as TryParse(string?, out MailFathomPermission) compares it, because the same string travels as an OAuth scope.

Exceptions

ArgumentNullException

Thrown when entries is null.