BccCode.Privacy.ChangeHistory
0.13.2
See the version list below for details.
dotnet add package BccCode.Privacy.ChangeHistory --version 0.13.2
NuGet\Install-Package BccCode.Privacy.ChangeHistory -Version 0.13.2
<PackageReference Include="BccCode.Privacy.ChangeHistory" Version="0.13.2" />
<PackageVersion Include="BccCode.Privacy.ChangeHistory" Version="0.13.2" />
<PackageReference Include="BccCode.Privacy.ChangeHistory" />
paket add BccCode.Privacy.ChangeHistory --version 0.13.2
#r "nuget: BccCode.Privacy.ChangeHistory, 0.13.2"
#:package BccCode.Privacy.ChangeHistory@0.13.2
#addin nuget:?package=BccCode.Privacy.ChangeHistory&version=0.13.2
#tool nuget:?package=BccCode.Privacy.ChangeHistory&version=0.13.2
BccCode.Privacy.ChangeHistory
Connects BccCode.Privacy.EntityFrameworkCore and BccCode.ChangeHistory on one model, so events, links, changes and
history versions are read per organisation, like the current rows.
services.AddPrivacyChangeHistory(); // ChangeHistory's reader scope = the acting organisation
protected override void ConfigureEntities(ModelBuilder b)
{
b.UsePrivacy();
// ... entities, Personal(), Item() ...
b.UsePrivacyChangeHistory(); // last
}
UsePrivacyChangeHistory():
FilterEventsByOrganisation(): a reader sees an event, its payload and trace only when all its links belong to the acting organisation. An event that spans organisations, or has a link without an owner, is read only withIgnoreQueryFilters()(maintenance).FilterHistoryByCurrentRow(): history versions are read only while the current row passes the privacy filter.HasEventOwner(<organisation>)on every personal table.ExcludeFromVersioning()on the package's columns (usable,reader_org): a basis change makes no history version.
PrivacyChangeHistory.Check(context) refuses, at start-up, a ChangeHistory context with personal tables whose model
was not set up this way. Hosting calls it.
In a mixed or ownerless event, Changes() and ChangesFor() keep the change to the reader's own row, with the
event's name, actor and reason left empty.
Deleted rows
By default the history of a deleted row is hidden, as the row is. IncludeDeleted() opts one read in, for retract,
undo and the audit of deletions:
var versions = await db.History.IncludeDeleted().Versions<Member>().Where(v => v.Entity.Id == id).ToListAsync();
await using var past = await db.History.IncludeDeleted().AsOfAsync(before);
A deleted row is shown only when the privacy filter passes on its last version: the row was the acting organisation's,
and its usable flag for the active process was set when it was deleted. Another organisation never sees it, and
IgnoreQueryFilters() is not needed (it would drop both checks).
Versions tested
BccCode.ChangeHistory 0.4.68 from nuget.org (tag change-history-v0.4.68, with EraseByIdAsync(ids, include) returning
a MaintenanceResult per table, and IncludeDeleted). It depends on EF Core 10.0.15 and Npgsql's provider 10.0.3, the
versions these packages pin. Versions 0.4.43 to 0.4.63 are partial releases; do not use them.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- BccCode.ChangeHistory (>= 0.4.68)
- BccCode.Privacy.EntityFrameworkCore (>= 0.13.2)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.15)
- Microsoft.Extensions.Caching.Memory (>= 10.0.15)
- Microsoft.Extensions.Compliance.Abstractions (>= 10.11.0)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 10.0.3)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on BccCode.Privacy.ChangeHistory:
| Package | Downloads |
|---|---|
|
BccCode.Privacy.Hosting
One AddPrivacy() for BCC Privacy: the EF Core, ASP.NET Core and Wolverine packages wired together, defaults per environment, the privacy document at /.well-known/bcc-privacy, and the application's processes and data items pushed to the Privacy API at deploy. |
GitHub repositories
This package is not used by any popular GitHub repositories.