mirror of
https://github.com/apache/superset.git
synced 2026-07-20 13:45:47 +00:00
MCPPermissionDeniedError(PermissionError) was being caught by the generic PermissionError branch in _handle_error before reaching its own handler, so the ToolError message was sanitized to "You don't have access to this resource." instead of the structured permission message. Move the MCPPermissionDeniedError branch above PermissionError so the subclass is matched first. Also fix four visibility test patch targets: auth.py imports security_manager at module level via `from superset import security_manager`, so tests must patch `superset.mcp_service.auth.security_manager` (not `superset.security_manager`) to intercept calls inside auth.py. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>