refactor(permissions): enhance role-based access controls across knowledge base and agent views
- Updated visibility conditions for various UI elements based on user roles, ensuring that only users with appropriate permissions (Admin, Contributor, or KB creator) can access certain actions. - Introduced computed properties to manage permissions for sharing knowledge bases, managing data sources, and executing graph extraction. - Adjusted the AgentList and KnowledgeBase components to reflect these changes, improving user experience by preventing unauthorized actions from being displayed. - Ensured that the backend routes are aligned with the updated frontend role checks, enhancing security and clarity in user interactions.
This commit is contained in:
@@ -679,9 +679,12 @@ func RegisterMCPServiceRoutes(
|
||||
|
||||
agentTool := r.Group("/agent")
|
||||
{
|
||||
// Resolving a pending tool-approval lets the agent run a sensitive
|
||||
// external command on this tenant's behalf — Admin+.
|
||||
agentTool.POST("/tool-approvals/:pending_id", g.Admin(), handler.ResolveToolApproval)
|
||||
// Resolving a pending tool-approval is gated to tenant members
|
||||
// (Viewer+). The approval card surfaces inside an agent chat the
|
||||
// caller initiated — restricting it to Admin+ blocks the only
|
||||
// people who actually have context to approve, so the gate is
|
||||
// kept at "anyone in the tenant" instead.
|
||||
agentTool.POST("/tool-approvals/:pending_id", g.Viewer(), handler.ResolveToolApproval)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user