fix(pm): scope-guard misidentifies project IDs as task IDs & add Adminer to docker-compose - #18
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two changes: a fix for the
ProjectScopeGuardthat blocked Project Managers from viewing their project tasks, and a new Adminer service for local DB management.1. Fix: ProjectScopeGuard false-positive on
/project/:idroutesProblem
403 "Task is not available"when opening their project's Tasks tab.POST /) has no:idparam while listing (GET /project/:id) does.Root cause
The guard resolved
request.params?.idas a fallback taskId. On routes like:GET /project-mgmt/task/project/:idGET /project-mgmt/task/project/:id/allGET /project-mgmt/task/project/archived/:id...the
:idis a project UUID, so the guard queried thetasktable with a project ID → no row found →ForbiddenException('Task is not available')instead.Fix
src/project/guard/ProjectScope.guard.tsOnly fall back to the generic
:idparam when the request path is not a/project/…route. Explicittask_id/taskIdparams are unaffected, and task-scoped routes (/:id,/:id/members,PUT /:id, …) still enforce project-manager ownership exactly as before.2. Chore: Adminer service in docker-compose
Adds an
adminercontainer for convenient local PostgreSQL inspection:5555:8080postgreshealthcheck before starting (depends_on.condition)backend_networkValidation
403 Task is not availabledocker compose up -d adminer→ reachable athttp://localhost:5555