fix: scope MCP permission guards to PAT requests and drop the project-count cap#248
Merged
Merged
Conversation
…-count cap
permissionGuard.js: the permission/role guards now run only for PAT (MCP / API-token) requests (req.apiToken). JWT/web-app requests pass straight through, so existing frontend/backend behaviour is byte-for-byte unchanged - fixes false denials on shared web routes (e.g. assigning a task). Also adds user_timesheet + workload_timesheet to MCP_PERMISSION_KEYS.
createProject/controller.js: checkProjectPlan no longer enforces a plan project-count cap; creation is gated only by the project.project_create permission. Always resolves { status: true }.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
parth0025
added a commit
that referenced
this pull request
Jun 16, 2026
Companion to #248: the owner-only role-promotion check in updateMember now runs only for PAT/MCP requests (req.apiToken), so the web app's role management behaves exactly as before. Same 2026-06-15 MCP-isolation hardening as permissionGuard.js. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
parth0025
added a commit
that referenced
this pull request
Jun 16, 2026
…249) * fix: address safe CodeRabbit findings from the promotion (#240) review Six low-risk, verified fixes: - Webhooks/dispatcher.js: guard against an undefined pending entry in the debounce callback (entry.doc could throw). - gitlabOAuth/controller.js: add a 15s timeout to the token-exchange axios call (was unbounded). - Admin/common/controller.js: drop an erroneous JSON.parse in the missing-file branch (makeDefaultBrandSettings resolves an object) - fixes a first-run 404 on getBrandSettingsData. - Stickies/helpers/stickyRules.js: strict boolean for isPinned (the string 'false' no longer coerces to true). - StickiesPanel.vue: clear the pending debounced save in remove() so it cannot fire a stale PUT after delete. - README.md: 'Priority support & SLAs' -> 'response-time targets' to match SUPPORT.md. Verified: node --check (backend), sticky-rules jest 16/16, StickiesPanel SFC compile. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix: scope updateMember role-promotion guard to PAT requests Companion to #248: the owner-only role-promotion check in updateMember now runs only for PAT/MCP requests (req.apiToken), so the web app's role management behaves exactly as before. Same 2026-06-15 MCP-isolation hardening as permissionGuard.js. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 16, 2026
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.
Two fixes that stop over-restrictive gating from affecting the web app.
Config/permissionGuard.js
requireRole,requirePermission,requireTaskActionPermission) now run ONLY for PAT (MCP / API-token) requests, detected viareq.apiToken. JWT / web-app requests fall straight through, so existing frontend/backend behaviour is byte-for-byte unchanged.checkPermissionis not yet a perfect match for per-project overrides, so gating shared web routes caused false denials in production (e.g. assigning a task -> 403). Scoping enforcement to PAT-only removes that risk while keeping MCP / API clients gated.sheet_settings.user_timesheetandsheet_settings.workload_timesheettoMCP_PERMISSION_KEYS.Modules/createProject/controller.js
checkProjectPlanno longer enforces a plan project-count cap. Project creation is gated only by theproject.project_createpermission (route guard + MCP client) —checkProjectPlannow always resolves{ status: true }.Both files syntax-checked (
node --check).🤖 Generated with Claude Code