CyberEye.DataScope.Lib
3.0.34
dotnet add package CyberEye.DataScope.Lib --version 3.0.34
NuGet\Install-Package CyberEye.DataScope.Lib -Version 3.0.34
<PackageReference Include="CyberEye.DataScope.Lib" Version="3.0.34" />
<PackageVersion Include="CyberEye.DataScope.Lib" Version="3.0.34" />
<PackageReference Include="CyberEye.DataScope.Lib" />
paket add CyberEye.DataScope.Lib --version 3.0.34
#r "nuget: CyberEye.DataScope.Lib, 3.0.34"
#:package CyberEye.DataScope.Lib@3.0.34
#addin nuget:?package=CyberEye.DataScope.Lib&version=3.0.34
#tool nuget:?package=CyberEye.DataScope.Lib&version=3.0.34
CyberEye.DataScope.Lib
Hợp đồng và quy tắc phân vùng dữ liệu theo ứng dụng, tenant và đơn vị. Package độc lập với ASP.NET Core/storage; gateway ở các package dữ liệu thực thi quy tắc này.
Target framework: net8.0.
Cài đặt
dotnet add package CyberEye.DataScope.Lib
Cần cấu hình NuGet feed của dự án và chọn phiên bản tương thích với các package CyberEye khác trong host.
Khai báo entity
using Ce.DataScope.Lib;
[DataScopePolicy(DataScopeKind.Tenant)]
public class Document : IDataScopedEntity
{
public int Id { get; set; }
public DataScopeKind DataScopeKind { get; set; }
public string ApplicationCode { get; set; }
public int? TenantId { get; set; }
public int? OrganId { get; set; }
}
Đây là fragment khai báo hợp đồng, chưa tạo cơ chế phân quyền. Host phải cung cấp context/authorizer và dùng scoped gateway của EF/Dapper/MongoDB/Elasticsearch.
Quy tắc tích hợp
- Không lấy ApplicationCode/TenantId/OrganId tùy ý từ payload để xác định quyền.
- Nếu cần ghi nguồn dữ liệu System, dùng hợp đồng ISourceSystemStampedEntity riêng.
- DataScopePolicy là attribute trên entity, không phải [DataScope] filter trên controller.
- Bypass cần authorizer và audit sink; không dùng như cách bỏ qua lỗi phân quyền.
- Kiểm thử cách ly giữa ứng dụng/tenant với cả luồng đọc và ghi.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. 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. |
-
net8.0
- No dependencies.
NuGet packages (5)
Showing the top 5 NuGet packages that depend on CyberEye.DataScope.Lib:
| Package | Downloads |
|---|---|
|
CyberEye.Common.Lib
Package chứa các hàm tiện ích, các base class, abstract class |
|
|
CyberEye.Infrastructure.Dto
Package chứa các Dto của những Service Core |
|
|
CyberEye.Orm.Lib
Package cung cấp CRUD tương tác với các CSDL quan hệ |
|
|
CyberEye.MongoDb.Lib
Package cung cấp CRUD tương tác với NoSql MongoDb |
|
|
CyberEye.Elasticsearch.Lib
Package cung cấp CRUD tương tác với NoSql Elasticsearch |
GitHub repositories
This package is not used by any popular GitHub repositories.