IBeam.AccessControl.Api 2.8.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package IBeam.AccessControl.Api --version 2.8.0
                    
NuGet\Install-Package IBeam.AccessControl.Api -Version 2.8.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IBeam.AccessControl.Api" Version="2.8.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IBeam.AccessControl.Api" Version="2.8.0" />
                    
Directory.Packages.props
<PackageReference Include="IBeam.AccessControl.Api" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IBeam.AccessControl.Api --version 2.8.0
                    
#r "nuget: IBeam.AccessControl.Api, 2.8.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package IBeam.AccessControl.Api@2.8.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=IBeam.AccessControl.Api&version=2.8.0
                    
Install as a Cake Addin
#tool nuget:?package=IBeam.AccessControl.Api&version=2.8.0
                    
Install as a Cake Tool

IBeam.AccessControl.Api

IBeam.AccessControl.Api provides optional ASP.NET Core endpoint wiring for managing IBeam access-control grants, permission-role maps, and service-operation permission rules over HTTP. It is for teams that want runtime administration APIs instead of configuration-only or script-only management.

When To Use This

  • You want admins or internal tools to manage resource grants dynamically.
  • You want API endpoints for permission-to-role mappings.
  • You want API endpoints for service-operation allow/deny rules.
  • You are comfortable exposing these capabilities behind a strong authorization policy.

Do not install this package if access-control rules should only be changed through configuration, migrations, or locked-down scripts.

What This Package Contains

Area Type(s) Purpose
Endpoint mapping MapIBeamAccessControl(...) Adds access-control route groups to an ASP.NET Core app.
Service registration helper AddIBeamAccessControlServices(...) usage Runtime services are registered from the services package.
Permission-map endpoints Minimal API handlers Manage role grants by permission name or permission ID.
Service-operation endpoints Minimal API handlers Manage operation allow/deny rules and check operation access.
Resource-grant endpoints Minimal API handlers Manage resource grants and resource access checks.

Architecture Fit

API <-- DTO/model object --> Service <-- Entity --> Repository

This package is API-only. Endpoints should stay thin: bind route/body data, call one access-control service method, and return the result. Authorization rules, permission evaluation, validation, and persistence belong in IBeam.AccessControl.Services and repository packages.

Quick Start

using IBeam.AccessControl.Api;
using IBeam.AccessControl.Services;

builder.Services.AddAuthentication();
builder.Services.AddAuthorization();
builder.Services.AddIBeamAccessControlServices(builder.Configuration);
builder.Services.AddIBeamServiceOperationPermissionManagement();

var app = builder.Build();

app.UseAuthentication();
app.UseAuthorization();

app.MapIBeamAccessControl("/api", authorizationPolicy: "AccessControlAdmin");

Endpoint Overview

Default route prefix:

app.MapIBeamAccessControl("/api", authorizationPolicy: "AccessControlAdmin");

Representative endpoints:

GET    /api/tenants/{tenantId}/access-control/grants
POST   /api/tenants/{tenantId}/access-control/grants
PUT    /api/tenants/{tenantId}/access-control/grants/{grantId}
DELETE /api/tenants/{tenantId}/access-control/grants/{grantId}
POST   /api/tenants/{tenantId}/access-control/grants/check

GET    /api/tenants/{tenantId}/access-control/permission-maps
PUT    /api/tenants/{tenantId}/access-control/permission-maps/by-name/{permissionName}
PUT    /api/tenants/{tenantId}/access-control/permission-maps/by-id/{permissionId}
DELETE /api/tenants/{tenantId}/access-control/permission-maps/by-name/{permissionName}
DELETE /api/tenants/{tenantId}/access-control/permission-maps/by-id/{permissionId}

GET    /api/tenants/{tenantId}/access-control/service-permissions
POST   /api/tenants/{tenantId}/access-control/service-permissions
PUT    /api/tenants/{tenantId}/access-control/service-permissions/{ruleId}
POST   /api/tenants/{tenantId}/access-control/service-permissions/{ruleId}/disable
DELETE /api/tenants/{tenantId}/access-control/service-permissions/{ruleId}
POST   /api/tenants/{tenantId}/access-control/service-permissions/check

Example operation rule request:

{
  "pattern": "pricing.*",
  "effect": "allow",
  "subjectTypes": [ "user" ],
  "roleNames": [ "Accounting" ],
  "roleIds": [],
  "priority": 0
}

Configuration

This package primarily depends on service-layer configuration.

Section Purpose
IBeam:AccessControl Resource access options.
IBeam:Services:Authorization Service-operation allow/deny rules.
IBeam:AccessControl:AzureTable Persistent store configuration when Azure Table repositories are installed.

Service Operations, Auditing, And Permissions

The API package does not implement authorization rules itself. It should be protected by host ASP.NET Core authorization:

app.MapIBeamAccessControl("/api", authorizationPolicy: "AccessControlAdmin");

The services called by these endpoints are operation-tagged and audited by IBeam.AccessControl.Services when IBeam service auditing is enabled.

Data Storage

This API package does not create or own storage. It calls service/store abstractions.

Storage Item Created By This Package Notes
Access-control tables No Use IBeam.AccessControl.Repositories.AzureTable or a custom store.
In-memory stores No Registered by IBeam.AccessControl.Services.
API request logs No Use host logging/middleware.

For Azure Table schema, see ../IBeam.AccessControl.Repositories.AzureTable/README.md.

Extension Points

Extension Point Interface/Hook Why Replace It
Route prefix MapIBeamAccessControl(prefix, policy) Mount under a host-specific API prefix.
Authorization policy ASP.NET Core policy name Lock management endpoints to owners/admins.
Stores access-control store interfaces Persist dynamic grants and rules.
API surface host endpoint composition Skip this package and manage rules through scripts/config if dynamic APIs are not desired.

Extended Docs And Agent Guidance

Agents should preserve the thin API pattern and keep permission logic in the service layer.

Troubleshooting

Problem Likely Cause Fix
Endpoints return 401/403 Host auth/policy not satisfied Verify authentication and the mapping policy.
Dynamic updates do not persist In-memory stores are active Register a persistent repository package after services.
Operation check always denies No matching rule or wrong operation name Verify service method [IBeamOperation] names and configured patterns.
API package feels too open Runtime management is optional Remove this package and manage access-control through config/scripts.

Version Notes

  • Targets net10.0.
  • Built for optional dynamic management.
  • Package version is assigned by the repository release workflow.
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.9.1 81 7/23/2026
2.9.0 84 7/21/2026
2.8.2 77 7/21/2026
2.8.1 73 7/21/2026
2.8.0 79 7/21/2026
2.7.0 78 7/21/2026
2.6.0 88 7/20/2026
2.5.0 91 7/17/2026
2.4.2 89 7/16/2026
2.4.1 90 7/14/2026
2.4.0 108 6/24/2026