Skip to content

feat(admin-settings): allow_user_dashboards runtime gate#61

Merged
rubenvdlinde merged 2 commits intodevelopmentfrom
feature/impl-allow-personal-dashboards-flag
Apr 30, 2026
Merged

feat(admin-settings): allow_user_dashboards runtime gate#61
rubenvdlinde merged 2 commits intodevelopmentfrom
feature/impl-allow-personal-dashboards-flag

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

Summary

Implements REQ-ASET-003 (modified) + REQ-ASET-015 (added) per spec on development. Adds PersonalDashboardsDisabledException + DashboardService::assertPersonalDashboardsAllowed() + controller guard on create(). Existing personal dashboards remain fully usable; only creation is blocked when flag is off. Initial-state push already done by PR #45. PHPUnit covers envelope shape, no-mutation, defence-in-depth. Fork-side wiring deferred to fork-current-as-personal PR.

  • New PersonalDashboardsDisabledException (HTTP 403, stable error code personal_dashboards_disabled)
  • DashboardService::assertPersonalDashboardsAllowed() reads flag with default=false (missing row = blocked per spec)
  • Controller guard in create() only; 403 envelope exactly: {status:'error', error:'personal_dashboards_disabled', message:<translated>}
  • Existing personal dashboards remain readable/editable/deletable — read/update/delete untouched
  • i18n: EN + NL strings in all 4 l10n files (json + js)
  • REQ-ASET-015 initial-state already done by PR feat(infra): typed initial-state contract #45 — skipped
  • Fork-side wiring deferred to fork-current-as-personal PR

Test plan

  • PHPUnit 7 new tests: envelope shape (error code + HTTP 403 + message), readable/editable/deletable with flag off, default-blocks-creation, no-mutation, pass-when-flag-on
  • Manual: POST /api/dashboards with flag=0 returns 403 with correct envelope
  • Manual: GET /api/dashboards/visible still returns existing personal dashboards when flag off
  • Manual: PUT /api/dashboards/{id} and DELETE still work on existing dashboards when flag off

…er REQ-ASET-003 + 015

Implements REQ-ASET-003 (modified) runtime gating: when allow_user_dashboards flag
is OFF, POST /api/dashboards returns HTTP 403 with {status:'error',
error:'personal_dashboards_disabled', message:<translated>}.

- New PersonalDashboardsDisabledException (HTTP 403, stable error code)
- DashboardService::assertPersonalDashboardsAllowed() reads setting with default=false
- DashboardApiController::create() calls assert before permission checks; catches
  exception and returns exact spec envelope; read/update/delete untouched
- i18n: English + Dutch strings in all four l10n files (json + js)
- PHPUnit: 7 tests covering envelope shape, readability/editability with flag off,
  no-mutation guarantee, default-blocks-creation, defence-in-depth
- REQ-ASET-015 initial-state mirror already done in PR #45 (InitialStateBuilder);
  skip per spec instruction
- Fork-side wiring deferred to fork-current-as-personal PR
- Pre-existing: fixed 13 phpcbf-auto-fixable blank-line errors in DashboardApiController
@rubenvdlinde rubenvdlinde added the ready-for-code-review Build complete — awaiting code reviewer label Apr 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/mydash @ b72245c

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 103/103
npm ✅ 342/342
PHPUnit ⏭️
Newman ⏭️
Playwright ⏭️

Quality workflow — 2026-04-30 19:34 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde rubenvdlinde merged commit 56a6381 into development Apr 30, 2026
3 of 4 checks passed
@rubenvdlinde rubenvdlinde deleted the feature/impl-allow-personal-dashboards-flag branch April 30, 2026 19:35
rubenvdlinde added a commit that referenced this pull request May 3, 2026
* feat(admin-settings): runtime gating on personal-dashboard creation per REQ-ASET-003 + 015

Implements REQ-ASET-003 (modified) runtime gating: when allow_user_dashboards flag
is OFF, POST /api/dashboards returns HTTP 403 with {status:'error',
error:'personal_dashboards_disabled', message:<translated>}.

- New PersonalDashboardsDisabledException (HTTP 403, stable error code)
- DashboardService::assertPersonalDashboardsAllowed() reads setting with default=false
- DashboardApiController::create() calls assert before permission checks; catches
  exception and returns exact spec envelope; read/update/delete untouched
- i18n: English + Dutch strings in all four l10n files (json + js)
- PHPUnit: 7 tests covering envelope shape, readability/editability with flag off,
  no-mutation guarantee, default-blocks-creation, defence-in-depth
- REQ-ASET-015 initial-state mirror already done in PR #45 (InitialStateBuilder);
  skip per spec instruction
- Fork-side wiring deferred to fork-current-as-personal PR
- Pre-existing: fixed 13 phpcbf-auto-fixable blank-line errors in DashboardApiController

* chore: update SBOM

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-code-review Build complete — awaiting code reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant