Repository navigation
refa: remove permission service wrappers - #21856
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Handler authorization internal/handler/*, internal/router/router.go |
Handlers use database-backed resource checks for canvas, dataset, and document access. Retrieval handler wiring and tests use a permission checker. The router comment now refers to “the permission checker.” |
Canvas, agent, and bot access internal/service/agent.go, internal/service/agent_sessions.go, internal/service/bot*.go, internal/service/canvas_permission.go |
Agent and bot services use checker resource checks and scopes for canvas access. The canvas permission helper file was removed. |
Chat, channel, and session access internal/service/chat*.go, internal/service/chat_channel*.go |
Chat, channel, and session services use checker resource checks and scopes. Their service-specific permission helpers were removed. |
Dataset and document access internal/service/chunk/chunk.go, internal/service/dataset*.go, internal/service/dataset/*, internal/service/document/* |
Dataset, document, and chunk services use database-backed resource checks. Dataset access and operator-permission helpers were removed. |
Connector and sync-task access internal/service/connector*.go |
Connector operations use resource checks and scopes for sync tasks. Connector permission helpers were removed. |
MCP server access internal/service/mcp*.go |
MCP operations use database checker methods and hidden-error normalization. MCP permission helpers were removed. |
Memory access and scopes internal/service/memory*.go |
Memory operations use checker checks, scopes, and resource filtering. Memory permission helpers were removed. |
Skill-space access internal/service/skill_space*.go, internal/service/skill_search.go |
Skill-space and skill-search operations use checker scopes and hidden-error normalization. Skill-space permission helpers were removed. |
Feature checks and ownership grants internal/service/chat.go, internal/service/chat_channel.go, internal/service/mcp.go, internal/service/memory.go, internal/service/model_service.go, internal/service/search.go, internal/service/tenant_context.go, internal/service/operator_permission.go |
Services call database checker feature and ownership methods directly. Shared feature, ownership, and operator-permission helpers were removed. |
Estimated code review effort: 4 (Complex) | ~60 minutes
Change: Refactor
Suggested reviewers: ccclucky
Merge Risk: 
Minimal · up to 34ecd
-
No concrete merge-blocking risk was identified in this change.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 36 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks each gate with care,
The canvas paths and datasets there.
One checker now can scope the view,
And hidden errors keep their cue.
Helpers hop away from sight,
While grants and checks align just right.
What problem does this PR solve?
Remove service-layer permission wrappers that only forwarded calls, and invoke the permission layer directly at call sites. Keep composite authorization rules with their owning business flows.
Type of change