Skip to content

feat: restrict zaken per supplier to zaaktypen configured with a star… - #70

Merged
richardkorthuis merged 5 commits into
mainfrom
feature/zaaktype-start-dates-allowlist
Nov 19, 2026
Merged

richardkorthuis merged 5 commits into
mainfrom
feature/zaaktype-start-dates-allowlist

Conversation

@richardkorthuis

Copy link
Copy Markdown
Member

…t date

The 'Startdatum per zaaktype' setting is now an allowlist per supplier with zaaktype filtering. As soon as a supplier has at least one configured zaaktype, only zaken of its configured zaaktypen, started on or after the configured date, are shown. Suppliers without configured zaaktypen keep showing all zaken.

  • Apply the allowlist in every 'Mijn zaken' block (also without a zaaktype selection), on the zaak detail page and to informatieobject downloads
  • Only offer the allowed zaaktypen in the block editor, warn about selected zaaktypen that are no longer allowed and allow removing them
  • Treat rows whose supplier can't be resolved as restricting every filtering supplier, resolve them afterwards in the daily zaaktypen cron and show a persistent notice on the settings page while they exist
  • Drop removed rows on save, as CMB2 keeps their hidden fields
  • Add ZaaktypeStartDates::resolve() and memoize the start dates per supplier
  • Move the zaaktype identificatie and start date helpers from Block to ZaaktypeAdapter and ZaaktypeStartDates
  • Log downloads blocked by the setting as a notice instead of an error

…t date

The 'Startdatum per zaaktype' setting is now an allowlist per supplier with
zaaktype filtering. As soon as a supplier has at least one configured zaaktype,
only zaken of its configured zaaktypen, started on or after the configured
date, are shown. Suppliers without configured zaaktypen keep showing all zaken.

- Apply the allowlist in every 'Mijn zaken' block (also without a zaaktype
  selection), on the zaak detail page and to informatieobject downloads
- Only offer the allowed zaaktypen in the block editor, warn about selected
  zaaktypen that are no longer allowed and allow removing them
- Treat rows whose supplier can't be resolved as restricting every filtering
  supplier, resolve them afterwards in the daily zaaktypen cron and show a
  persistent notice on the settings page while they exist
- Drop removed rows on save, as CMB2 keeps their hidden fields
- Add ZaaktypeStartDates::resolve() and memoize the start dates per supplier
- Move the zaaktype identificatie and start date helpers from Block to
  ZaaktypeAdapter and ZaaktypeStartDates
- Log downloads blocked by the setting as a notice instead of an error

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical issues allow concurrent cron updates to overwrite administrator settings and supplier key/name mismatches to bypass allowlist checks on zaak detail URLs.

2 open issues
1 file not reviewed
  • build/mijn-zaken/index.js: Generated file
What changed in this PR

This PR makes “Startdatum per zaaktype” a supplier-specific allowlist across Mijn zaken overviews, case details, and document downloads. Suppliers without configured case types, or without case-type filtering enabled, remain unrestricted.

Changes:

  • Centralizes allowlist and start-date checks, with cached per-supplier lookups.
  • Limits block-editor choices and adds warnings and removal controls for disallowed selections.
  • Adds daily resolution of unresolved settings rows, persistent notices, and removed-row cleanup.
File Description
src/​WPCron/​Events/​PopulateZaaktypen.php Runs identity backfill after refreshing case types.
src/​Settings/​ZaaktypeStartDates.php Centralizes supplier allowlists, date checks, and caching.
src/​Settings/​ZaaktypeStartDateIdentities.php Resolves previously unknown case-type identities.
src/​Settings/​OptionsPageRegistrar.php Updates setting guidance, row cleanup, and notices.
src/​Settings/​Adapters/​ZaaktypeAdapter.php Houses the shared case-type identification helper.
src/​Services/​InformatieObjectDownloadService.php Blocks excluded downloads and logs a notice.
src/​Providers/​BlockServiceProvider.php Supplies allowed editor choices and restriction metadata.
src/​Blocks/​Zaak.php Applies the allowlist to case details.
src/​Blocks/​Block.php Applies supplier restrictions to case overviews.
resources/​blocks/​mijn-zaken/​edit.js Adds restriction warnings and selection cleanup controls.
config/​php-di.php Passes filtering suppliers into the shared settings service.
build/​mijn-zaken/​index.js Updates the compiled block-editor script.
build/​mijn-zaken/​index.asset.php Updates the editor asset version.

Review effort: Balanced

Comment thread src/Blocks/Zaak.php Resolved
richardkorthuis and others added 2 commits November 17, 2026 11:16
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ktype identities

The daily zaaktypen cron read the whole settings option, resolved the missing
zaaktype identities (possibly with live ZTC requests) and then wrote that
original snapshot back. Settings saved by an administrator in the meantime
were lost, including unrelated settings, and deleted 'Startdatum per zaaktype'
rows came back.

- Resolve the identities first, without writing anything
- Then re-read the settings from the database and only add the identities to
  rows that still exist, still have the same zaaktype and still lack an
  identificatie
- Write with a compare-and-swap on the value just read, and retry up to three
  times when the settings changed in between

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The compare-and-swap uses a case-insensitive database collation, allowing it to overwrite concurrent casing-only edits instead of retrying; a binary comparison is needed to preserve the concurrency guarantee.

1 open issue
2 resolved since last review
1 file not reviewed
  • build/mijn-zaken/index.js: Generated file

Review effort: Balanced

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@mvdhoek1 mvdhoek1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Klopt het dat sites die al rijen bij "Startdatum per zaaktype" hebben ingevuld na deze update opeens alle andere zaaktypen van die leverancier niet meer zien?

Ook niet vergeten om languages/owc-mijn-services.pot bij te werken straks.
Idem voor de @since NEXT.

@richardkorthuis

Copy link
Copy Markdown
Member Author

@mvdhoek1 Dat klopt, dat is door Martin gevraagd, als er zaaktypes zijn ingesteld dan alleen die zaaktypes tonen.

@richardkorthuis
richardkorthuis merged commit 51340ab into main Nov 19, 2026
1 check passed
@richardkorthuis
richardkorthuis deleted the feature/zaaktype-start-dates-allowlist branch November 19, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants