![]() |
VOOZH | about |
dotnet add package SimpleModule.Permissions --version 0.0.38
NuGet\Install-Package SimpleModule.Permissions -Version 0.0.38
<PackageReference Include="SimpleModule.Permissions" Version="0.0.38" />
<PackageVersion Include="SimpleModule.Permissions" Version="0.0.38" />Directory.Packages.props
<PackageReference Include="SimpleModule.Permissions" />Project file
paket add SimpleModule.Permissions --version 0.0.38
#r "nuget: SimpleModule.Permissions, 0.0.38"
#:package SimpleModule.Permissions@0.0.38
#addin nuget:?package=SimpleModule.Permissions&version=0.0.38Install as a Cake Addin
#tool nuget:?package=SimpleModule.Permissions&version=0.0.38Install as a Cake Tool
Permission management module for SimpleModule — a modular monolith framework for .NET.
sm install SimpleModule.Permissions
Or via .NET CLI:
dotnet add package SimpleModule.Permissions
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).
The module is auto-discovered by the SimpleModule framework. Use
IPermissionsContracts to check permissions from other modules.
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.38 | 86 | 6/3/2026 |
| 0.0.37 | 88 | 6/3/2026 |
| 0.0.36 | 98 | 5/1/2026 |
| 0.0.35 | 96 | 4/30/2026 |
| 0.0.34 | 103 | 4/29/2026 |
| 0.0.33 | 108 | 4/23/2026 |
| 0.0.32 | 116 | 4/23/2026 |
| 0.0.30 | 108 | 4/1/2026 |
| 0.0.29 | 111 | 4/1/2026 |
| 0.0.28 | 106 | 4/1/2026 |
| 0.0.27 | 108 | 3/30/2026 |
| 0.0.26 | 108 | 3/30/2026 |
| 0.0.25 | 103 | 3/30/2026 |
| 0.0.24 | 106 | 3/30/2026 |
| 0.0.23 | 103 | 3/30/2026 |
| 0.0.22 | 105 | 3/30/2026 |
| 0.0.21 | 114 | 3/29/2026 |
| 0.0.20 | 106 | 3/29/2026 |
| 0.0.19 | 109 | 3/29/2026 |
| 0.0.18 | 129 | 3/28/2026 |