Skip to content

UI Gaps in Multi-Tenancy Support - Visibility fields missing for most resource types #967

@crivetimihai

Description

@crivetimihai

Summary

The Admin UI lacks critical multi-tenancy features that are fully supported in the backend, making team-based resource management unusable for several resource types through the web interface.

Environment

  • Component: Admin UI (/admin endpoints and templates)
  • Version: v0.7.0+ (post multi-tenancy implementation)
  • Affected Files: mcpgateway/admin.py, mcpgateway/templates/admin.html

Current Behavior

Visibility Field Support (Inconsistent)

  • Working: Gateways, Virtual Servers, Tools, Teams have visibility fields
  • Missing: Resources, Prompts, A2A Agents have NO visibility controls

Verified Code Evidence:

  • ✅ Gateways: Has visibility (lines 5535, 5745)
  • ✅ Virtual Servers: Has visibility (lines 837, 1007)
  • ✅ Tools: Has visibility (lines 4780, 4818)
  • ✅ Teams: Has visibility selector (lines 3052-3055)
  • ❌ Resources: NO visibility field (lines 6069-6077)
  • ❌ Prompts: NO visibility field (lines 6570-6576)
  • ❌ A2A Agents: NO visibility field (lines 8446-8454)

Team Management (Missing)

  • ❌ No team selector dropdown in ANY create/edit forms
  • ❌ Cannot assign resources to teams through UI
  • ❌ No visual indication of team ownership

Visual Indicators (Missing)

  • ❌ No visibility badges in list views (except teams)
  • ❌ No owner email display
  • ❌ No team name shown for resources

Expected Behavior

All resource types should have:

  1. Visibility selector (Private/Team/Public) in create/edit forms
  2. Team selector dropdown to assign resources to teams
  3. Visibility badges in list views
  4. Owner email and team name display
  5. Consistent UI across all resource types

Steps to Reproduce

  1. Login to Admin UI (/admin)
  2. Try to create a new Resource
  3. Observe: No visibility field available
  4. Try to create a new Prompt
  5. Observe: No visibility field available
  6. Create a new Tool
  7. Observe: Has visibility field but no team selector
  8. View list of resources
  9. Observe: No visibility badges or owner information shown

Impact

Severity: HIGH

  • Multi-tenancy feature is unusable through UI for 3 out of 7 resource types
  • Users forced to use API directly for team-based resource management
  • No visibility into resource ownership or team assignments
  • Confusing UX with inconsistent feature availability

Affected Users

  • All users trying to use team-based resource management
  • Enterprise customers requiring multi-tenancy support
  • Administrators managing team resources

Root Cause Analysis

The backend was updated with full multi-tenancy support but the UI was only partially updated:

  • Backend models have team_id, owner_email, visibility fields
  • Backend services support team-scoped queries
  • UI forms and templates were not updated consistently
  • Only 4 of 7 resource types had visibility fields added to forms

Proposed Solution

1. Add Visibility Fields to Missing Resources

# Add to Resources, Prompts, A2A creation forms
visibility = str(form.get("visibility", "private"))

2. Add Team Selector to ALL Forms

# Add team_id field to all resource creation
team_id = form.get("team_id") or user_personal_team_id

3. Update Templates with Visibility Badges

// In admin.html - Add to all resource cards
<span class="badge visibility-${item.visibility}">
  ${item.visibility.toUpperCase()}
</span>

4. Display Owner and Team Information

<!-- Add to resource cards -->
<div class="meta-info">
  <small>Owner: ${item.owner_email} | Team: ${item.team_name}</small>
</div>

Checklist for Fix

  • Add visibility select to Resource create/edit forms
  • Add visibility select to Prompt create/edit forms
  • Add visibility select to A2A Agent create/edit forms
  • Add team selector to ALL resource forms
  • Add visibility badges to list views
  • Add owner email display to cards
  • Add team name display to cards
  • Update team visibility options (add "team" option)
  • Test all resource types with different visibility levels
  • Verify team scoping works in UI
  • Update UI documentation

Related Issues

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfrontendFrontend development (HTML, CSS, JavaScript)

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions