MasLazu.AspNet.Authorization.Core.Abstraction
1.0.0-preview.7
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
<PackageReference Include="MasLazu.AspNet.Authorization.Core.Abstraction" Version="1.0.0-preview.7" />
<PackageVersion Include="MasLazu.AspNet.Authorization.Core.Abstraction" Version="1.0.0-preview.7" />
<PackageReference Include="MasLazu.AspNet.Authorization.Core.Abstraction" />
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"
#:package MasLazu.AspNet.Authorization.Core.Abstraction@1.0.0-preview.7
#addin nuget:?package=MasLazu.AspNet.Authorization.Core.Abstraction&version=1.0.0-preview.7&prerelease
#tool nuget:?package=MasLazu.AspNet.Authorization.Core.Abstraction&version=1.0.0-preview.7&prerelease
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>:
- IActionService - Manages actions (operations that can be performed)
- IPermissionService - Manages permissions (specific allowances)
- IPermissionTypeService - Manages permission types (categories of permissions)
- IResourceService - Manages resources (entities that actions can be performed on)
- 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 likeBaseDto,BaseUpdateRequest, andICrudService
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 | 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
- FastEndpoints (>= 7.0.1)
- FluentValidation (>= 12.0.0)
- MasLazu.AspNet.Framework.Application (>= 1.0.0-preview.15)
- MasLazu.AspNet.Framework.Domain (>= 1.0.0-preview.15)
- Microsoft.Extensions.DependencyInjection (>= 9.0.9)
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 |