ApricotFramework.AccessAuthorization.ErrorDefinitions
0.1.0
Prefix Reserved
dotnet add package ApricotFramework.AccessAuthorization.ErrorDefinitions --version 0.1.0
NuGet\Install-Package ApricotFramework.AccessAuthorization.ErrorDefinitions -Version 0.1.0
<PackageReference Include="ApricotFramework.AccessAuthorization.ErrorDefinitions" Version="0.1.0" />
<PackageVersion Include="ApricotFramework.AccessAuthorization.ErrorDefinitions" Version="0.1.0" />
<PackageReference Include="ApricotFramework.AccessAuthorization.ErrorDefinitions" />
paket add ApricotFramework.AccessAuthorization.ErrorDefinitions --version 0.1.0
#r "nuget: ApricotFramework.AccessAuthorization.ErrorDefinitions, 0.1.0"
#:package ApricotFramework.AccessAuthorization.ErrorDefinitions@0.1.0
#addin nuget:?package=ApricotFramework.AccessAuthorization.ErrorDefinitions&version=0.1.0
#tool nuget:?package=ApricotFramework.AccessAuthorization.ErrorDefinitions&version=0.1.0
ApricotFramework.AccessAuthorization
Authorization for .NET built on an ordered rule pipeline: deny by default, with statically assigned accesses as one rule among several. One call answers both is this allowed and what is allowed, so a user interface and a gate can never disagree.
ApricotFramework.AccessAuthorization is the zero-dependency core.
Install
dotnet add package ApricotFramework.AccessAuthorization
dotnet add package ApricotFramework.AccessAuthorization.AspNetCore
Usage
using ApricotFramework.AccessAuthorization.AspNetCore.Extensions;
builder.Services.AddAccessAuthorization(builder.Configuration);
builder.Services.AddAccessStore<MyAccessStore>(); // where assigned accesses come from
builder.Services.AddAccessCatalog(ContentAccesses.All); // needed only to list capabilities
builder.Services.AddAccessBypassRule<RootBypassRule>(); // runs before the assigned lookup
builder.Services.AddAccessRule<OwnerCanEditRule>(); // runs after it
The attributes work unchanged on a controller action, a minimal-API endpoint and a gRPC method, because they carry their requirement as endpoint metadata rather than running as an MVC filter:
[AuthorizeAnyAccess(ContentAccesses.OrdersRead)]
public object Get(string id) => this.repository.Find(id);
[AuthorizeAllScopes("sales.read")] // on a gRPC method
public override Task<GetOrderReply> GetOrder(GetOrderRequest request, ServerCallContext context) => …
And the listing a user interface renders from, which runs the same pipeline as the gates:
var allowed = await httpContext.GetAllowedAccessesAsync(AccessResource.Create("sales:order", id));
Subject attributes are strings, since they come from claims and key the cache; resource and
environment attributes keep their domain types, so a rule matches rather than parses
(if (resource.Attributes["isPublic"] is true)).
Note that an assigned access ignores the resource: a granted sales:orders:edit means the
subject may edit orders, not one particular order. Narrowing a grant to an instance is a rule of your
own, registered after the assigned lookup — see the docs for why that division is deliberate.
Denials carry an RFC 9457 problem-details body — from an attribute as well as from an imperative
check — if you add ApricotFramework.AccessAuthorization.ErrorDefinitions.
Full documentation: https://projectapricot.dev/docs/access-authorization
| 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
- ApricotFramework.AccessAuthorization (>= 0.1.0)
- ApricotFramework.AccessAuthorization.AspNetCore (>= 0.1.0)
- ApricotFramework.ErrorDefinitions.AspNetCore (>= 0.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 118 | 8/31/2026 |