diff --git a/zddc/internal/handler/fileapi_test.go b/zddc/internal/handler/fileapi_test.go index da5971b..1fb9b39 100644 --- a/zddc/internal/handler/fileapi_test.go +++ b/zddc/internal/handler/fileapi_test.go @@ -511,11 +511,12 @@ func TestFileAPI_WORM_DocControllerNeedsExplicitGrant(t *testing.T) { t.Fatalf("dc without explicit grant → issued: want 403, got %d: %s", rec.Code, rec.Body.String()) } - // Operator places an explicit grant at archive/Acme/issued/.zddc. - // Now dc has cr at-or-below the WORM folder, which survives the mask. - issuedZ := []byte(`acl: - permissions: - _doc_controller: cr + // Operator places an explicit worm: grant at archive/Acme/issued/.zddc + // naming the document-controller role. That principal then gets + // {r, c} inside the WORM zone — the embedded `worm: {}` (no + // controllers) is unioned with this deeper grant. + issuedZ := []byte(`worm: + _doc_controller: cr `) if err := os.WriteFile(filepath.Join(root, "Project-X/archive/Acme/issued/.zddc"), issuedZ, 0o644); err != nil { t.Fatalf("write issued .zddc: %v", err) @@ -604,16 +605,16 @@ func TestFileAPI_AutoMkdirOwnership(t *testing.T) { func TestFileAPI_AutoMkdirNotInIssued(t *testing.T) { _, do, root := rolePermissionsTestSetup(t) - // Place an explicit grant so dc has cr at the issued level. - issuedZ := []byte("acl:\n permissions:\n _doc_controller: cr\n") + // Place an explicit worm: grant so dc has cr in the issued WORM zone. + issuedZ := []byte("worm:\n _doc_controller: cr\n") if err := os.WriteFile(filepath.Join(root, "Project-X/archive/Acme/issued/.zddc"), issuedZ, 0o644); err != nil { t.Fatalf("seed issued .zddc: %v", err) } zddc.InvalidateCache(root) - // Doc controller mkdir under issued — should succeed (cr survives mask) - // but should NOT auto-write an ownership .zddc (issued is excluded - // from auto-own). + // Doc controller mkdir under issued — should succeed (cr survives the + // WORM mask) but should NOT auto-write an ownership .zddc (issued is + // not declared auto_own in the cascade). rec := do(http.MethodPost, "/Project-X/archive/Acme/issued/2026-Q2/", "dc@mycompany.com", nil, map[string]string{ "X-ZDDC-Op": "mkdir", }) diff --git a/zddc/internal/handler/tables.html b/zddc/internal/handler/tables.html index 0c45836..2b8b288 100644 --- a/zddc/internal/handler/tables.html +++ b/zddc/internal/handler/tables.html @@ -1300,7 +1300,7 @@ body.help-open .app-header {