IBeam.AccessControl 2.9.0

dotnet add package IBeam.AccessControl --version 2.9.0
                    
NuGet\Install-Package IBeam.AccessControl -Version 2.9.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" Version="2.9.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IBeam.AccessControl" Version="2.9.0" />
                    
Directory.Packages.props
<PackageReference Include="IBeam.AccessControl" />
                    
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 --version 2.9.0
                    
#r "nuget: IBeam.AccessControl, 2.9.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@2.9.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&version=2.9.0
                    
Install as a Cake Addin
#tool nuget:?package=IBeam.AccessControl&version=2.9.0
                    
Install as a Cake Tool

IBeam.AccessControl

IBeam.AccessControl contains the provider-neutral contracts and models for tenant-scoped access grants, permission-to-role mappings, and service-operation authorization. It is intentionally independent from IBeam.Identity so teams can use IBeam access control with their own authentication system.

When To Use This

  • You need to describe access to tenant resources such as projects, products, workspaces, modules, or records.
  • You want roles to map to stable permission names or IDs.
  • You want service operations like pricing.save or coupons.delete to be authorized by configurable rules.
  • You need user, API credential, and agent subjects to share one access model.

What This Package Contains

Area Type(s) Purpose
Resource subjects AccessSubject, AccessSubjectTypes Identifies who receives access, such as a user, API credential, or agent.
Resource grants ResourceAccessGrantRecord, GrantResourceAccessRequest, CheckResourceAccessRequest Models tenant-scoped grants to a resource type/id at an access level.
Permission maps PermissionRoleMapRecord, PermissionGrantSet, UpsertPermissionRoleMapRequest Maps permission names/IDs to role names and role IDs.
Service-operation rules ServiceOperationPermissionRule, ServiceOperationAuthorizationOptions Allows or denies operation-name patterns such as pricing.*.
Interfaces IResourceAccessStore, IResourceAccessService, IPermissionRoleMapStore, IServiceOperationAuthorizer, and related contracts Defines storage and service boundaries without choosing an implementation.
Options AccessControlOptions Configures access-level rank comparison and JWT claim emission limits.

Architecture Fit

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

This package is the model/contract layer. Authorization decisions happen in IBeam.AccessControl.Services. Optional HTTP endpoints live in IBeam.AccessControl.Api. Optional Azure Table persistence lives in IBeam.AccessControl.Repositories.AzureTable.

Quick Start

Most apps should install this package through a service or API package. If you are building your own service layer, consume the contracts directly:

public sealed class ProjectAccessPolicy
{
    private readonly IResourceAccessAuthorizer _authorizer;

    public ProjectAccessPolicy(IResourceAccessAuthorizer authorizer)
    {
        _authorizer = authorizer;
    }

    public async Task RequireProjectEditAsync(Guid tenantId, string projectId, string userId, CancellationToken ct)
    {
        var result = await _authorizer.AuthorizeAsync(
            tenantId,
            "project",
            projectId,
            new AccessSubject(AccessSubjectTypes.User, userId),
            ResourceAccessLevels.Edit,
            ct);

        if (!result.Allowed)
            throw new UnauthorizedAccessException(result.Reason);
    }
}

Configuration

AccessControlOptions is bound from IBeam:AccessControl.

{
  "IBeam": {
    "AccessControl": {
      "EmitResourceAccessClaim": true,
      "MaxResourceAccessClaimsInJwt": 200,
      "AccessLevelRanks": {
        "view": 10,
        "edit": 20,
        "delete": 30,
        "manage": 40,
        "admin": 50,
        "owner": 60,
        "*": 2147483647
      }
    }
  }
}
Setting Default Purpose
EmitResourceAccessClaim true Allows callers to include compact resource-access claims when building JWTs.
MaxResourceAccessClaimsInJwt 200 Caps how many resource claims should be emitted.
AccessLevelRanks built-in ranks Compares access levels so higher grants imply lower access.

Service Operations, Auditing, And Permissions

Service operation authorization uses stable operation names created in service-layer code:

[IBeamOperation("purchases.archive")]
public Task ArchivePurchaseAsync(Guid tenantId, Guid purchaseId, CancellationToken ct = default)
    => _operations.ExecuteAsync(
        this,
        token => ArchivePurchaseCoreAsync(tenantId, purchaseId, token),
        new ServiceOperationExecutionOptions
        {
            TenantId = tenantId,
            EntityId = purchaseId
        },
        ct);

Rules can then allow or deny names and patterns:

{
  "IBeam": {
    "Services": {
      "Authorization": {
        "Enabled": true,
        "DefaultMode": "require-permission",
        "Rules": [
          {
            "Pattern": "pricing.*",
            "Effect": "allow",
            "RoleNames": [ "Accounting" ]
          },
          {
            "Pattern": "coupons.delete",
            "Effect": "deny",
            "RoleNames": [ "Accounting" ],
            "Priority": 100
          }
        ]
      }
    }
  }
}

Data Storage

This core package does not create tables. It defines store interfaces only.

Storage Item Created By This Package Notes
Resource grants No Use IBeam.AccessControl.Services in-memory stores or a repository package.
Permission-role maps No Implement IPermissionRoleMapStore or use Azure Table storage.
Service-operation permission rules No Implement IServiceOperationPermissionStore or use Azure Table storage.

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

Extension Points

Extension Point Interface Why Replace It
Resource access storage IResourceAccessStore Persist grants in Azure Table, EF, SQL, or another store.
Resource hierarchy IResourceAccessHierarchyResolver Let product-level grants imply project-level access.
Permission map storage IPermissionRoleMapStore Store role grants by permission name or ID.
Operation rule providers IServiceOperationPermissionRuleProvider Load rules from config, database, scripts, or another source.
Operation authorization IServiceOperationAuthorizer Plug service operation rules into IServiceOperationExecutor.

Package Relationships

Package Relationship
IBeam.AccessControl Core models and interfaces.
IBeam.AccessControl.Services Implements access checks, authorization rules, and in-memory stores.
IBeam.AccessControl.Api Optional HTTP endpoints for dynamic management.
IBeam.AccessControl.Repositories.AzureTable Optional Azure Table persistence.
IBeam.Services Provides [IBeamOperation] and IServiceOperationExecutor.

Extended Docs And Agent Guidance

Agents should read the AI prompt before adding permissions, grants, or service operation authorization behavior.

Troubleshooting

Problem Likely Cause Fix
Operation authorization always denies No matching rule and default mode requires permission Add a config/store rule or change DefaultMode deliberately.
Role names work but role IDs do not Claims or mappings are missing role IDs Include rid claims and populate RoleIds.
Resource access does not cascade No hierarchy resolver registered Implement IResourceAccessHierarchyResolver.
Using your own auth system feels blocked Identity is not required Map your principal/roles/tenant into the access-control abstractions.

Version Notes

  • Targets net10.0.
  • Designed to support bring-your-own-auth.
  • 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.
  • net10.0

    • No dependencies.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on IBeam.AccessControl:

Package Downloads
IBeam.Identity

IBeam modular framework components for .NET APIs and services.

IBeam.Services

Root services package that aggregates abstractions and core service implementations.

IBeam.AccessControl.Services

Tenant resource access services and in-memory store for IBeam-backed applications.

IBeam.AccessControl.Repositories.AzureTable

Azure Table Storage stores for IBeam access-control resource grants, permission maps, and service operation permissions.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.9.0 63 7/21/2026
2.8.2 58 7/21/2026
2.8.1 59 7/21/2026
2.8.0 96 7/21/2026
2.7.0 134 7/21/2026
2.6.0 157 7/20/2026
2.5.0 179 7/17/2026
2.4.2 155 7/16/2026
2.4.1 107 7/14/2026
2.4.0 133 6/24/2026