Skip to content

Commit ff3d587

Browse files
msukkariclaude
andauthored
fix(web): hide workspace connectors menu item from non-owners (#1256)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d3b4f8f commit ff3d587

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

packages/web/src/ee/features/chat/mcp/components/connectorsMenu.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ import {
3333
saveMcpOAuthDraft,
3434
} from "@/features/chat/mcpOAuthDraft";
3535
import { clearEditorHistory, resetEditor } from "@/features/chat/utils";
36+
import { useRole } from "@/features/auth/useRole";
37+
import { OrgRole } from "@sourcebot/db";
3638

3739
interface ConnectorsMenuProps {
3840
selectedSearchScopes: SearchScope[];
@@ -76,6 +78,7 @@ export const ConnectorsMenu = ({
7678
const queryClient = useQueryClient();
7779
const router = useRouter();
7880
const { toast } = useToast();
81+
const isOwner = useRole() === OrgRole.OWNER;
7982

8083
const { data: servers = [], isError, isLoading, refetch } = useQuery({
8184
queryKey: mcpQueryKeys.serversWithStatus,
@@ -297,13 +300,15 @@ export const ConnectorsMenu = ({
297300
<CableIcon className="w-4 h-4" />
298301
My connectors
299302
</DropdownMenuItem>
300-
<DropdownMenuItem
301-
className="gap-2 text-muted-foreground"
302-
onSelect={() => router.push(`/settings/workspaceAskAgent`)}
303-
>
304-
<SettingsIcon className="w-4 h-4" />
305-
Workspace connectors
306-
</DropdownMenuItem>
303+
{isOwner && (
304+
<DropdownMenuItem
305+
className="gap-2 text-muted-foreground"
306+
onSelect={() => router.push(`/settings/workspaceAskAgent`)}
307+
>
308+
<SettingsIcon className="w-4 h-4" />
309+
Workspace connectors
310+
</DropdownMenuItem>
311+
)}
307312
</DropdownMenuSubContent>
308313
</DropdownMenuSub>
309314
</DropdownMenuContent>

0 commit comments

Comments
 (0)