SimpleModule.Permissions
0.0.35
See the version list below for details.
dotnet add package SimpleModule.Permissions --version 0.0.35
NuGet\Install-Package SimpleModule.Permissions -Version 0.0.35
<PackageReference Include="SimpleModule.Permissions" Version="0.0.35" />
<PackageVersion Include="SimpleModule.Permissions" Version="0.0.35" />
<PackageReference Include="SimpleModule.Permissions" />
paket add SimpleModule.Permissions --version 0.0.35
#r "nuget: SimpleModule.Permissions, 0.0.35"
#:package SimpleModule.Permissions@0.0.35
#addin nuget:?package=SimpleModule.Permissions&version=0.0.35
#tool nuget:?package=SimpleModule.Permissions&version=0.0.35
SimpleModule.Permissions
Permission management module for SimpleModule — a modular monolith framework for .NET.
Features
- Role-based access control (RBAC) with database persistence
- Permission seeding for initial setup
- Cross-module authorization via contracts
- Permission assignment to roles
- Fine-grained endpoint authorization
Installation
sm install SimpleModule.Permissions
Or via .NET CLI:
dotnet add package SimpleModule.Permissions
Defining Permissions in Your Own Modules
Any module — including modules you write in a downstream app — can contribute
permissions. Permission classes are auto-discovered by the SimpleModule source
generator: you do not need to call AddPermissions<T>() yourself.
The convention is one sealed class per module implementing IModulePermissions,
containing only public const string fields named Module.Action:
using SimpleModule.Core.Authorization;
namespace MyApp.Customers;
public sealed class CustomersPermissions : IModulePermissions
{
public const string View = "Customers.View";
public const string Create = "Customers.Create";
public const string Update = "Customers.Update";
public const string Delete = "Customers.Delete";
}
Apply them on endpoints using the RequirePermission extension method or the
[RequirePermission] attribute:
public sealed class CreateCustomerEndpoint : IEndpoint
{
public void Map(IEndpointRouteBuilder app) =>
app.MapPost("/", (CreateCustomerRequest request) => /* ... */)
.RequirePermission(CustomersPermissions.Create);
}
The role-edit UI groups permissions by the prefix before the first dot
(Customers.View → "Customers" group), so your custom permissions appear
alongside framework permissions automatically.
If you scaffold modules with sm new module <Name>, a starter
<Name>Permissions.cs is generated for you.
See the Permissions guide for the full authorization model (claims transformation, wildcard matching, testing patterns).
Usage
The module is auto-discovered by the SimpleModule framework. Use
IPermissionsContracts to check permissions from other modules.
License
MIT
| 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
- SimpleModule.Core (>= 0.0.35)
- SimpleModule.Database (>= 0.0.35)
- SimpleModule.Permissions.Contracts (>= 0.0.35)
- SimpleModule.Users.Contracts (>= 0.0.35)
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.0.36 | 43 | 5/1/2026 |
| 0.0.35 | 52 | 4/30/2026 |
| 0.0.34 | 81 | 4/29/2026 |
| 0.0.33 | 92 | 4/23/2026 |
| 0.0.32 | 103 | 4/23/2026 |
| 0.0.30 | 94 | 4/1/2026 |
| 0.0.29 | 96 | 4/1/2026 |
| 0.0.28 | 91 | 4/1/2026 |
| 0.0.27 | 96 | 3/30/2026 |
| 0.0.26 | 95 | 3/30/2026 |
| 0.0.25 | 90 | 3/30/2026 |
| 0.0.24 | 90 | 3/30/2026 |
| 0.0.23 | 92 | 3/30/2026 |
| 0.0.22 | 92 | 3/30/2026 |
| 0.0.21 | 102 | 3/29/2026 |
| 0.0.20 | 93 | 3/29/2026 |
| 0.0.19 | 97 | 3/29/2026 |
| 0.0.18 | 118 | 3/28/2026 |
| 0.0.17 | 139 | 3/28/2026 |
| 0.0.16 | 142 | 3/28/2026 |