Skip to content

connectors: enforce VIEWER role restriction on connector/tool creation#238

Merged
keysersoft merged 1 commit into
mainfrom
claude/fix-viewer-connector-auth-XMkTa
May 20, 2026
Merged

connectors: enforce VIEWER role restriction on connector/tool creation#238
keysersoft merged 1 commit into
mainfrom
claude/fix-viewer-connector-auth-XMkTa

Conversation

@keysersoft
Copy link
Copy Markdown
Contributor

Summary

Connector/tool creation and import endpoints only ran JWT auth and license checks, while update/delete paths reject VIEWER users via assertCanWrite / assertCanWriteConnector. This left the read-only role inconsistent: viewers could create connectors and MCP tools.

This PR closes that gap by applying the existing VIEWER restriction to all creation/import paths:

  • Add an assertCanCreate helper on ConnectorsController and call it from create (POST /api/connectors) and importAll (POST /api/connectors/import-all).
  • Add the same VIEWER check to AdaptersController.importAdapter (POST /api/adapters/:slug/import).

Test plan

  • New connectors.controller.spec.ts and adapters.controller.spec.ts — 9 tests asserting VIEWER receives ForbiddenException and EDITOR/ADMIN still succeed on all three endpoints.
  • Full backend suite: 2836 passed, no regressions.
  • eslint and tsc --noEmit clean.

https://claude.ai/code/session_01XJiM3Vsk1D98hbYaDiRJJp


Generated by Claude Code

Connector/tool creation and import endpoints only ran JWT auth and
license checks, while update/delete paths reject VIEWER users via
assertCanWrite/assertCanWriteConnector. This made the read-only role
inconsistent: viewers could create connectors and MCP tools.

Add an assertCanCreate helper and apply the VIEWER check to:
- POST /api/connectors
- POST /api/connectors/import-all
- POST /api/adapters/:slug/import

Add regression tests proving VIEWER gets 403 and EDITOR/ADMIN succeed.

https://claude.ai/code/session_01XJiM3Vsk1D98hbYaDiRJJp
@keysersoft keysersoft requested a review from D3nisty as a code owner May 20, 2026 20:29
@keysersoft keysersoft merged commit fd51b66 into main May 20, 2026
11 checks passed
@keysersoft keysersoft deleted the claude/fix-viewer-connector-auth-XMkTa branch May 20, 2026 20:34
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.

2 participants