Skip to content

Make File Search folder rules do what the Files panel says (#1388) - #1419

Merged
helpcodeai merged 1 commit into
mainfrom
fix/file-search-folder-rules
Nov 1, 2026
Merged

helpcodeai merged 1 commit into
mainfrom
fix/file-search-folder-rules

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

Summary

Reported by another session reviewing origin/main: the folder-permission code contradicted the docs and the Files panel ("A role without rules sees everything; with rules only the allowed folders, and deny wins").

  • As soon as a connector had one rule (e.g. "Sales: deny Intern"), every role without a rule saw nothing: one rule cut everyone else off.
  • A role with only deny rules also saw nothing.

Changes

FileSearchEngine.scopeFor now does what the docs and the UI say:

  • A role without rules sees everything; a rule for one role never changes what other roles see.
  • Allow rules narrow a role to those folders. If any of the caller's roles has no allow rules, the caller is not narrowed.
  • Deny rules hide folders and always win.
  • Workspace administrators see everything (as before when no rule applied to them).
  • Calls without a user (MCP API keys) are not narrowed, as before. The docs now say so explicitly.

Also, numbers and dates in the File Search UI follow the app's language (<html lang>), not the browser's: the English wizard showed "50.000 files".

Cloud and self-hosted alike; folder rules are Enterprise only.

Type

  • Bug fix

Testing

  • Added/updated unit tests
Directory Command Result
packages/backend npx tsc --noEmit -p tsconfig.json clean
packages/backend npx jest src/file-search src/ee/file-search --maxWorkers=4 12 suites, 59 passed (new file-search-scope.spec.ts, 5 cases)
packages/backend npm run lint 0 errors, 11 warnings (existing)
packages/frontend npx tsc --noEmit -p tsconfig.json clean
root node scripts/generate-llms-txt.mjs --check fresh

Related Issues

Relates to #1388, #1379.

A single rule hid every folder from all other roles, and a role with only
deny rules saw nothing. Now a role without rules sees everything, allow
rules narrow a role, deny always wins, administrators and API-key calls
are not narrowed. Numbers and dates in the File Search UI follow the
app's language instead of the browser's.
@helpcodeai
helpcodeai enabled auto-merge (squash) November 1, 2026 18:04
@helpcodeai
helpcodeai merged commit fbd80b6 into main Nov 1, 2026
15 checks passed
@helpcodeai
helpcodeai deleted the fix/file-search-folder-rules branch November 1, 2026 18:14
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant