MasLazu.AspNet.Authorization.Core.Domain
1.0.0-preview.7
dotnet add package MasLazu.AspNet.Authorization.Core.Domain --version 1.0.0-preview.7
NuGet\Install-Package MasLazu.AspNet.Authorization.Core.Domain -Version 1.0.0-preview.7
<PackageReference Include="MasLazu.AspNet.Authorization.Core.Domain" Version="1.0.0-preview.7" />
<PackageVersion Include="MasLazu.AspNet.Authorization.Core.Domain" Version="1.0.0-preview.7" />
<PackageReference Include="MasLazu.AspNet.Authorization.Core.Domain" />
paket add MasLazu.AspNet.Authorization.Core.Domain --version 1.0.0-preview.7
#r "nuget: MasLazu.AspNet.Authorization.Core.Domain, 1.0.0-preview.7"
#:package MasLazu.AspNet.Authorization.Core.Domain@1.0.0-preview.7
#addin nuget:?package=MasLazu.AspNet.Authorization.Core.Domain&version=1.0.0-preview.7&prerelease
#tool nuget:?package=MasLazu.AspNet.Authorization.Core.Domain&version=1.0.0-preview.7&prerelease
MasLazu.AspNet.Authorization.Core.Domain
This project contains the domain entities for the MasLazu ASP.NET Authorization Core system. It defines the core business objects that represent the authorization model, including actions, permissions, resources, and their relationships.
Overview
The Domain layer represents the heart of the authorization system, containing the entities that model the business concepts. These entities are used throughout the application to maintain data integrity and enforce business rules.
Entities
The project defines five main domain entities:
1. Action
Represents an operation that can be performed in the system.
public class Action : BaseEntity
{
public string Code { get; set; } // Unique identifier code
public string Name { get; set; } // Human-readable name
}
2. Permission
Represents a specific permission that can be granted.
public class Permission : BaseEntity
{
public string Code { get; set; } // Unique permission code
public string Name { get; set; } // Permission name
public string Description { get; set; } // Detailed description
public string TypeCode { get; set; } // RBAC or ABAC classification
}
3. PermissionType
Categorizes permissions into types (e.g., system permissions, user-defined permissions).
public class PermissionType : BaseEntity
{
public string Code { get; set; } // Type code (e.g., "SYSTEM", "USER")
public string Description { get; set; } // Type description
}
4. Resource
Represents an entity or object that actions can be performed on.
public class Resource : BaseEntity
{
public string Code { get; set; } // Unique resource code
public string Name { get; set; } // Resource name
}
5. ResourceAction
Junction entity that links permissions to specific resource-action combinations.
public class ResourceAction : BaseEntity
{
public string PermissionCode { get; set; } // References Permission.Code
public string ResourceCode { get; set; } // References Resource.Code
public string ActionCode { get; set; } // References Action.Code
// Navigation properties
public Resource? Resource { get; set; }
public Action? Action { get; set; }
public Permission? Permission { get; set; }
}
Base Entity
All entities inherit from BaseEntity (from MasLazu.AspNet.Framework.Domain), which typically provides:
Guid Id- Primary keyDateTimeOffset CreatedAt- Creation timestampDateTimeOffset? UpdatedAt- Last update timestamp
Relationships
The entities form the following relationships:
- Permission ↔ PermissionType: Many permissions can belong to one type (via TypeCode)
- ResourceAction → Permission: Links to the permission being granted
- ResourceAction → Resource: Links to the resource the permission applies to
- ResourceAction → Action: Links to the action being permitted
This structure supports both Role-Based Access Control (RBAC) and Attribute-Based Access Control (ABAC) through the TypeCode field.
Dependencies
This project depends on:
MasLazu.AspNet.Framework.Domain- Provides theBaseEntityclass and other domain framework components
Usage
These entities are used by:
- Abstraction Layer: Defines the contracts and DTOs
- EF Core Layer: Maps entities to database tables
- Core Layer: Implements business logic and services
The domain entities serve as the foundation for the entire authorization system, ensuring consistency across all layers of the application.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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. |
-
net9.0
- MasLazu.AspNet.Framework.Domain (>= 1.0.0-preview.15)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on MasLazu.AspNet.Authorization.Core.Domain:
| Package | Downloads |
|---|---|
|
MasLazu.AspNet.Authorization.Core.EfCore
EF Core data access layer for MasLazu.AspNet.Authorization.Core - contains database configurations and repository implementations. |
|
|
MasLazu.AspNet.Authorization.Core
Core business logic layer for MasLazu.AspNet.Authorization.Core - contains service implementations and validation for the authorization system. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-preview.7 | 138 | 10/9/2025 |
| 1.0.0-preview.6 | 127 | 10/9/2025 |
| 1.0.0-preview.5 | 129 | 10/9/2025 |
| 1.0.0-preview.1 | 173 | 9/20/2025 |