Trellis.Authorization
3.0.0-alpha.505
See the version list below for details.
dotnet add package Trellis.Authorization --version 3.0.0-alpha.505
NuGet\Install-Package Trellis.Authorization -Version 3.0.0-alpha.505
<PackageReference Include="Trellis.Authorization" Version="3.0.0-alpha.505" />
<PackageVersion Include="Trellis.Authorization" Version="3.0.0-alpha.505" />
<PackageReference Include="Trellis.Authorization" />
paket add Trellis.Authorization --version 3.0.0-alpha.505
#r "nuget: Trellis.Authorization, 3.0.0-alpha.505"
#:package Trellis.Authorization@3.0.0-alpha.505
#addin nuget:?package=Trellis.Authorization&version=3.0.0-alpha.505&prerelease
#tool nuget:?package=Trellis.Authorization&version=3.0.0-alpha.505&prerelease
Trellis.Authorization
Lightweight authorization primitives for permissions, actors, and resource-based checks.
Installation
dotnet add package Trellis.Authorization
Quick Example
using System.Collections.Generic;
using Trellis;
using Trellis.Authorization;
var actor = Actor.Create("user-1", new HashSet<string> { "orders:read" });
IResult result = actor.HasPermission("orders:read")
? Result.Ok()
: Result.Fail(new Error.Forbidden("policy.id") { Detail = "Missing permission." });
Key Features
AddSharedResourceAuthorization<TMessage,TResource,TId,TResponse>()fromTrellis.Mediatorregisters the typed behavior, accessor, and shared-loader bridge together; register yourSharedResourceLoaderById<TResource,TId>implementation separately. The lower-levelAddResourceAuthorization<TMessage,TResource,TResponse>()still leaves all loader registration to the caller.ActorIdopts into[Trim, NotDefault]; trimming and blank rejection are not the unannotatedRequiredString<T>defaults.- Defines
Actor,ActorId,IActorProvider,IAuthorize, and resource authorization interfaces. Actor.Idis the strongly-typedActorIdvalue object — reuse it on consumer aggregate boundaries (Order.CreatedByActorId,Document.LastModifiedByActorId) for type-checked principal-identity comparisons.- Works without ASP.NET Core, Mediator, or any web dependency.
- Keeps permission rules inside the same Result-based workflow as the rest of your application.
Documentation
Part of Trellis
This package is part of the Trellis framework.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- OpenTelemetry.Api (>= 1.18.0)
- Trellis.Core (>= 3.0.0-alpha.505)
NuGet packages (9)
Showing the top 5 NuGet packages that depend on Trellis.Authorization:
| Package | Downloads |
|---|---|
|
Trellis.Asp
ASP.NET Core integration for Trellis. Result-to-HTTP response mapping, named-route pagination links without an API-versioning dependency, rate-limit rejection handling, scalar value validation, JSON converters (with bundled AOT source generator), and ASP.NET actor providers (Claims, Entra, Easy Auth, Development) for Trellis.Authorization. |
|
|
Trellis.Mediator
Result-aware pipeline behaviors for martinothamar/Mediator. Provides validation, authorization, logging, tracing, and exception handling behaviors that understand Trellis Result types and short-circuit correctly. |
|
|
Trellis.Testing
FluentAssertions extensions and test doubles for Trellis - assert Result, Maybe, and Error types with readable fluent syntax |
|
|
Trellis.EntityFrameworkCore
EF Core integration for Trellis. Convention-based value converter registration, Result-returning persistence, Maybe/Result query extensions, typed seek pagination, and translated spherical nearby-query expressions. |
|
|
Trellis.Testing.AspNetCore
ASP.NET Core integration test utilities for Trellis - WebApplicationFactory helpers, DI service replacement, fake time providers, and MSAL token acquisition |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0-alpha.557 | 40 | 10/8/2026 |
| 3.0.0-alpha.554 | 103 | 10/8/2026 |
| 3.0.0-alpha.553 | 51 | 10/7/2026 |
| 3.0.0-alpha.542 | 150 | 10/5/2026 |
| 3.0.0-alpha.539 | 164 | 10/4/2026 |
| 3.0.0-alpha.532 | 173 | 10/2/2026 |
| 3.0.0-alpha.527 | 137 | 10/1/2026 |
| 3.0.0-alpha.526 | 111 | 9/30/2026 |
| 3.0.0-alpha.524 | 116 | 9/27/2026 |
| 3.0.0-alpha.520 | 130 | 9/25/2026 |
| 3.0.0-alpha.516 | 273 | 9/22/2026 |
| 3.0.0-alpha.513 | 125 | 9/22/2026 |
| 3.0.0-alpha.505 | 239 | 9/13/2026 |
| 3.0.0-alpha.495 | 322 | 8/24/2026 |
| 3.0.0-alpha.458 | 323 | 8/19/2026 |
| 3.0.0-alpha.455 | 223 | 8/19/2026 |
| 3.0.0-alpha.449 | 166 | 8/18/2026 |
| 3.0.0-alpha.447 | 168 | 8/18/2026 |
| 3.0.0-alpha.432 | 209 | 7/6/2026 |
| 3.0.0-alpha.428 | 178 | 7/3/2026 |