feat(audit)!: ScadaBridge C5 — collapse central dbo.AuditLog to 10 canonical cols + persisted computed cols; CollapseAuditLogToCanonical migration; repo writes canonical directly (Task 2.5)
This commit is contained in:
+6
-1
@@ -211,9 +211,14 @@ public class AddAuditLogTableMigrationTests : IClassFixture<MsSqlMigrationFixtur
|
||||
// WHERE 1=0 guarantees no rows are touched even if the permission check
|
||||
// somehow passes — the test asserts the engine rejects the statement
|
||||
// at permission-check time, not via a side effect on data.
|
||||
// C5 (Task 2.5): target a CANONICAL (non-computed) column. Status is now a
|
||||
// persisted computed column, and an UPDATE that sets a computed column is
|
||||
// rejected with a "cannot be modified" error BEFORE the permission check —
|
||||
// which would mask the DENY UPDATE this test exercises. Actor is a plain
|
||||
// writable column, so the permission check is the one that fires.
|
||||
cmd.CommandText =
|
||||
$"EXECUTE AS USER = '{testUser}'; " +
|
||||
$"UPDATE dbo.AuditLog SET Status = 'X' WHERE 1 = 0; " +
|
||||
$"UPDATE dbo.AuditLog SET Actor = 'X' WHERE 1 = 0; " +
|
||||
$"REVERT;";
|
||||
await cmd.ExecuteNonQueryAsync();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user