Skip to content

fix: use ListFileWriters for group file writer permission checks#923

Closed
nukima wants to merge 3 commits intonextlevelbuilder:devfrom
nukima:fix/group-file-writer-permission-check
Closed

fix: use ListFileWriters for group file writer permission checks#923
nukima wants to merge 3 commits intonextlevelbuilder:devfrom
nukima:fix/group-file-writer-permission-check

Conversation

@nukima
Copy link
Copy Markdown

@nukima nukima commented Apr 16, 2026

Summary

  • replace file-writer permission checks from CheckPermission() to ListFileWriters() in group/guild contexts
  • align check path with /addwriter grant path
  • preserve existing fail-open behavior and context guards
  • add unit tests for CheckFileWriterPermission

Validation

  • go build ./...
  • go build -tags sqliteonly ./internal/store ./internal/tools
  • go vet ./internal/store ./internal/tools
  • go test ./internal/store
  • go test ./internal/tools
  • go test ./internal/channels/feishu
  • go test ./internal/channels/telegram

Fixes #915

nukima added 2 commits April 16, 2026 12:46
Replace CheckPermission with ListFileWriters in file writer permission checks.
This aligns the permission check path with the grant path (/addwriter) and
improves cache efficiency by using the hot-path fwCache instead of the
generic permCache.

Changes:
- CheckFileWriterPermission() in config_permission_store.go now calls
  ListFileWriters() instead of CheckPermission()
- WriteFile() in context_file_interceptor.go uses the same ListFileWriters pattern
- All early-return guards and fail-open semantics preserved
- Added comprehensive unit tests for CheckFileWriterPermission

Fixes: nextlevelbuilder#915
@nukima nukima marked this pull request as draft April 16, 2026 06:04
@nukima nukima closed this Apr 16, 2026
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.

Bug - Telegram group: write_file checks writer permission against group:telegram:<id> instead of sender user

1 participant