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

This is a prerelease version of MasLazu.AspNet.Authorization.Core.Abstraction.
dotnet add package MasLazu.AspNet.Authorization.Core.Abstraction --version 1.0.0-preview.7
                    
NuGet\Install-Package MasLazu.AspNet.Authorization.Core.Abstraction -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.Abstraction" 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.Abstraction" Version="1.0.0-preview.7" />
                    
Directory.Packages.props
<PackageReference Include="MasLazu.AspNet.Authorization.Core.Abstraction" />
                    
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.Abstraction --version 1.0.0-preview.7
                    
#r "nuget: MasLazu.AspNet.Authorization.Core.Abstraction, 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.Abstraction@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.Abstraction&version=1.0.0-preview.7&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=MasLazu.AspNet.Authorization.Core.Abstraction&version=1.0.0-preview.7&prerelease
                    
Install as a Cake Tool

MasLazu.AspNet.Authorization.Core.Abstraction

This project provides the abstraction layer for the MasLazu ASP.NET Authorization Core system. It defines interfaces, data transfer objects (DTOs), and request models for managing authorization entities such as actions, permissions, resources, and their relationships.

Overview

The abstraction layer serves as the contract between the application's business logic and the underlying implementation. It ensures loose coupling and allows for different implementations (e.g., in-memory, database-backed) while maintaining a consistent API.

Key Components

Services

The project defines five main service interfaces, each inheriting from ICrudService<TDto, TCreateRequest, TUpdateRequest>:

  1. IActionService - Manages actions (operations that can be performed)
  2. IPermissionService - Manages permissions (specific allowances)
  3. IPermissionTypeService - Manages permission types (categories of permissions)
  4. IResourceService - Manages resources (entities that actions can be performed on)
  5. IResourceActionService - Manages resource-action mappings

Data Transfer Objects (DTOs)

Each service has a corresponding DTO that represents the data structure:

  • ActionDto - Contains action details (Id, Code, Name, timestamps)
  • PermissionDto - Contains permission details (Id, Code, Name, Description, TypeCode, timestamps)
  • PermissionTypeDto - Contains permission type details (Id, Code, Description, timestamps)
  • ResourceDto - Contains resource details (Id, Code, Name, timestamps)
  • ResourceActionDto - Contains resource-action mapping details (Id, PermissionCode, ResourceCode, ActionCode, timestamps)

Request Models

For create and update operations, the project defines request models:

  • Create*Request - For creating new entities
  • Update*Request - For updating existing entities (inherits from BaseUpdateRequest)

All request models use optional properties for updates, allowing partial updates.

Dependencies

This project depends on:

  • MasLazu.AspNet.Framework.Application - Provides base classes like BaseDto, BaseUpdateRequest, and ICrudService

Usage

Implement the service interfaces in your concrete implementation projects (e.g., Domain, EfCore) to provide the actual business logic and data access.

Example implementation structure:

MasLazu.AspNet.Authorization.Core.Abstraction (contracts)
├── MasLazu.AspNet.Authorization.Core.Domain (business logic)
├── MasLazu.AspNet.Authorization.Core.EfCore (data access)
└── MasLazu.AspNet.Authorization.Core (service registrations)

Entities Relationship

The authorization system manages the following relationships:

  • Actions represent operations (e.g., "read", "write", "delete")
  • Resources represent entities (e.g., "user", "post", "comment")
  • Permission Types categorize permissions (e.g., "system", "user-defined")
  • Permissions are specific allowances with a type
  • Resource Actions link permissions to specific resource-action combinations

This structure allows for flexible permission management where permissions can be granted for specific actions on specific resources.

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.Abstraction:

Package Downloads
MasLazu.AspNet.Authorization.Core.Endpoint

API endpoints layer for MasLazu.AspNet.Authorization.Core - contains FastEndpoints implementations for the authorization system.

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 140 10/9/2025
1.0.0-preview.6 134 10/9/2025
1.0.0-preview.5 132 10/9/2025
1.0.0-preview.1 159 9/20/2025