Lumen.Authorization
3.0.1
dotnet add package Lumen.Authorization --version 3.0.1
NuGet\Install-Package Lumen.Authorization -Version 3.0.1
<PackageReference Include="Lumen.Authorization" Version="3.0.1" />
<PackageVersion Include="Lumen.Authorization" Version="3.0.1" />
<PackageReference Include="Lumen.Authorization" />
paket add Lumen.Authorization --version 3.0.1
#r "nuget: Lumen.Authorization, 3.0.1"
#:package Lumen.Authorization@3.0.1
#addin nuget:?package=Lumen.Authorization&version=3.0.1
#tool nuget:?package=Lumen.Authorization&version=3.0.1
Lumen.Authorization
Pluggable role-based authorization library for ASP.NET Core (.NET 8). Manages Permissions, Profiles (roles), and User↔Profile assignments, backed by SQL Server and exposed via a mountable Backoffice UI.
Packages
| Package | Purpose |
|---|---|
Lumen.Authorization |
Core: domain, CQRS handlers, EF Core persistence, DI root |
Lumen.Authorization.Contracts |
Public interfaces (IUserPermissionService, IUserIdAccessor) and exported events |
Lumen.Authorization.Migrations |
EF Core migrations for the Lumen schema; hosted service applies them on startup |
Lumen.Authorization.AspNetCore |
ASP.NET Core glue: [RequirePermission], policy provider, discovery, enforcement |
Lumen.Authorization.Backoffice |
Razor Class Library with Profiles & Permissions management UI |
Minimum wiring in Program.cs
// Umbrella: registers core, migrations, enforcement, and discovery in one call
builder.Services.AddLumenAuthorization(builder.Configuration);
// Optional: mountable Backoffice UI
builder.Services.AddLumenBackoffice();
// ...
app.UseStaticFiles(); // serves _content/Lumen.Authorization.Backoffice/
app.UseAuthentication();
app.UseAuthorization();
app.MapLumenBackoffice("/lumen");
SQL Server is required. Provide the connection string via
IConfiguration["ConnectionStrings:DefaultConnection"]or use the string overload:AddLumenAuthorization("Server=...;Database=...;").
Protecting an endpoint
// Convention: permission code = "Controller.Action"
[RequirePermission]
public IActionResult Index() { ... }
// Explicit code
[RequirePermission("Profiles.Delete")]
public IActionResult Delete(Guid id) { ... }
Repository & documentation
- Source: https://github.com/KauaVilasBoas/Lumen
- Consumer guide:
docs/authz-library.mdin the repository - Architecture decision: ADR-0004
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- FluentValidation (>= 11.11.0)
- Lumen.Authorization.Contracts (>= 3.0.1)
- Lumen.Modularity (>= 1.0.0)
- MediatR (>= 12.4.1)
- Microsoft.EntityFrameworkCore.SqlServer (>= 8.0.15)
- Microsoft.Extensions.Caching.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Caching.Memory (>= 8.0.1)
- Microsoft.Extensions.Caching.StackExchangeRedis (>= 8.0.15)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- Microsoft.Extensions.Options (>= 8.0.2)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 8.0.11)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Lumen.Authorization:
| Package | Downloads |
|---|---|
|
Lumen.Authorization.Migrations
EF Core migrations for the Lumen authorization schema (SQL Server). Includes a hosted service that applies migrations automatically on startup. Add this package alongside Lumen.Authorization to enable schema management. |
|
|
Lumen.Authorization.AspNetCore
ASP.NET Core integration for Lumen.Authorization: [RequirePermission] attribute, IAuthorizationRequirementData-based policy enforcement, dynamic PermissionPolicyProvider, PermissionAuthorizationHandler, IUserIdAccessor/ClaimsUserIdAccessor, and the AddLumenAuthorization() umbrella that wires core, migrations, and enforcement in one call. |
|
|
Lumen.Authorization.Migrations.PostgreSQL
EF Core migrations for the Lumen authorization schema (PostgreSQL). Includes a hosted service that applies migrations automatically on startup. Add this package alongside Lumen.Authorization when targeting PostgreSQL. |
|
|
Lumen.Authorization.Backoffice
Razor Class Library providing a mountable Backoffice UI for Lumen.Authorization. Includes controllers, ViewComponents, and CSS for managing Permissions, Profiles, and User↔Profile assignments. Mount via AddLumenBackoffice() + MapLumenBackoffice("/lumen"). |
|
|
Lumen.Identity
Core of Lumen.Identity: user domain (User, tokens, lockout), JWT/HS256 with refresh-token rotation, BCrypt, email confirmation, password reset, and integration bridges (IAuthorizationUserSource, IUserDirectory) for Lumen.Authorization. DI entry-point: AddLumenIdentity(). |
GitHub repositories
This package is not used by any popular GitHub repositories.