test: add tests for PermissionMatrixService #31

Open
Charon wants to merge 2 commits from feat/test-permission-matrix-service into dev
Member

Summary

  • Add comprehensive Pest test suite for PermissionMatrixService covering 51 test cases
  • Tests cover: permission checks (can), top-down immutable hierarchy cascade, lock/unlock, setPermission, train, getPermissions/getEffectivePermissions, gateRequest (strict, non-strict, default_allow modes), training mode, pending requests workflow, and PermissionResult value object
  • Verifies M1→M2→M3 hierarchy enforcement: locked denials are immutable from above, children can self-restrict

Fixes #10

## Summary - Add comprehensive Pest test suite for `PermissionMatrixService` covering 51 test cases - Tests cover: permission checks (`can`), top-down immutable hierarchy cascade, `lock`/`unlock`, `setPermission`, `train`, `getPermissions`/`getEffectivePermissions`, `gateRequest` (strict, non-strict, default_allow modes), training mode, pending requests workflow, and `PermissionResult` value object - Verifies M1→M2→M3 hierarchy enforcement: locked denials are immutable from above, children can self-restrict Fixes #10
Charon added 2 commits 2026-03-24 16:34:36 +00:00
- Add `verified` middleware to billing route group so only
  email-verified users can access billing endpoints
- Separate read-only GET routes from state-changing POST routes
- Add `throttle:6,1` rate limiting to state-changing endpoints
  (cancel, resume, upgrade/preview, upgrade) — 6 requests per minute
- Reorganise route group with clear section comments

Fixes #13

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cover permission checks (can), top-down immutable hierarchy cascade,
lock/unlock, setPermission, train, getPermissions/getEffective,
gateRequest (strict/non-strict/default_allow), training mode, pending
requests workflow, and PermissionResult value object.

Fixes #10

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/test-permission-matrix-service:feat/test-permission-matrix-service
git checkout feat/test-permission-matrix-service

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git checkout dev
git merge --no-ff feat/test-permission-matrix-service
git checkout feat/test-permission-matrix-service
git rebase dev
git checkout dev
git merge --ff-only feat/test-permission-matrix-service
git checkout feat/test-permission-matrix-service
git rebase dev
git checkout dev
git merge --no-ff feat/test-permission-matrix-service
git checkout dev
git merge --squash feat/test-permission-matrix-service
git checkout dev
git merge --ff-only feat/test-permission-matrix-service
git checkout dev
git merge feat/test-permission-matrix-service
git push origin dev
Sign in to join this conversation.
No description provided.