MasLazu.AspNet.Authorization.Core.Domain 1.0.0-preview.7

This is a prerelease version of MasLazu.AspNet.Authorization.Core.Domain.
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
                    
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="MasLazu.AspNet.Authorization.Core.Domain" Version="1.0.0-preview.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MasLazu.AspNet.Authorization.Core.Domain" Version="1.0.0-preview.7" />
                    
Directory.Packages.props
<PackageReference Include="MasLazu.AspNet.Authorization.Core.Domain" />
                    
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 MasLazu.AspNet.Authorization.Core.Domain --version 1.0.0-preview.7
                    
#r "nuget: MasLazu.AspNet.Authorization.Core.Domain, 1.0.0-preview.7"
                    
#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 MasLazu.AspNet.Authorization.Core.Domain@1.0.0-preview.7
                    
#: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=MasLazu.AspNet.Authorization.Core.Domain&version=1.0.0-preview.7&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=MasLazu.AspNet.Authorization.Core.Domain&version=1.0.0-preview.7&prerelease
                    
Install as a Cake Tool

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 key
  • DateTimeOffset CreatedAt - Creation timestamp
  • DateTimeOffset? UpdatedAt - Last update timestamp

Relationships

The entities form the following relationships:

  • PermissionPermissionType: Many permissions can belong to one type (via TypeCode)
  • ResourceActionPermission: Links to the permission being granted
  • ResourceActionResource: Links to the resource the permission applies to
  • ResourceActionAction: 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 the BaseEntity class 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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