Tenant Context
Work within a specific tenant’s scope for focused operations.
What is Tenant Context?
Section titled “What is Tenant Context?”Tenant context is your current working tenant. When set, list views filter to that tenant automatically:
The tenant switcher is available to global administrators only. Regular tenant users are always scoped to their own tenant and do not see switching controls.
Why Use Tenant Context?
Section titled “Why Use Tenant Context?”| Benefit | Description |
|---|---|
| Focus | See only relevant data |
| Safety | Reduce accidental cross-tenant operations |
| Efficiency | Less filtering needed |
| Clarity | Always know which tenant you’re working in |
Context Indicator
Section titled “Context Indicator”Lens displays the current tenant context in the header. A Context: <name> label appears below the tenant switcher button whenever a tenant is active:
┌─────────────────────────────────────────────────────────────┐│ ┌──────────────────────────────────────────────────────┐ ││ │ MANTIS [Acme Corp ▼] │ ││ │ Context: Acme │ ││ │ │ ││ │ Dashboard │ ││ │ Deployments │ ││ │ Solutions │ ││ │ Targets │ ││ │ Environments │ ││ │ Tenants ← │ ││ └──────────────────────────────────────────────────────┘ ││ ││ Tenant context active. Data filtered to Acme Corp. ││ │└─────────────────────────────────────────────────────────────┘When no tenant is active the button shows All Tenants and no Context: label appears.
Setting Tenant Context
Section titled “Setting Tenant Context”From Header Dropdown
Section titled “From Header Dropdown”- Click the tenant selector button in the header
- Choose your tenant — the dropdown shows ★ Favorites first, then Recent (last 5), then the full list
- The view updates immediately to show only that tenant’s data
┌─────────────────────────────────────────────────────────────┐│ Select Tenant │├─────────────────────────────────────────────────────────────┤│ ││ Search: [________________________] ││ ││ ★ Favorites ││ ● Acme Corp (current) ★ ││ ───────────────────────────────────────────────────────── ││ Recent ││ ○ Beta Inc ││ ───────────────────────────────────────────────────────── ││ ○ Gamma LLC ││ ○ Delta Co ││ ───────────────────────────────────────────────────────── ││ ○ All Tenants (no filter) ││ │└─────────────────────────────────────────────────────────────┘From Tenant List or Detail Page
Section titled “From Tenant List or Detail Page”- Navigate to Tenants
- Click Set as context on any tenant row — or open the tenant detail page and use the Set as context button there
- When that tenant is already active, the button shows Active context ✓ with a Clear button to remove the context
Keyboard Shortcut
Section titled “Keyboard Shortcut”Press Ctrl+K (Windows/Linux) or Cmd+K (macOS) to open the tenant command palette. Type to filter, use ↑/↓ to navigate, Enter to select, and Esc to close.
Outside Lens
Section titled “Outside Lens”Tenant context is a Lens UI feature; there is no mantisctl context command. When
using the CLI or REST API, scope each operation to a tenant explicitly — for
example, pass --tenant-id <id> to mantisctl deployment commands, or include a
tenant_id in API request bodies and query parameters.
Context Effects
Section titled “Context Effects”Filtered Views
Section titled “Filtered Views”When context is set, list views automatically pass the active tenant’s ID to the API, so only that tenant’s resources appear.
Targets List
Section titled “Targets List”┌─────────────────────────────────────────────────────────────┐│ Targets - Acme Corp │├─────────────────────────────────────────────────────────────┤│ ││ Showing targets assigned to Acme Corp ││ ││ ┌────────────────┬──────────┬────────────────────────────┐││ │ Name │ Status │ Environment │││ ├────────────────┼──────────┼────────────────────────────┤││ │ acme-web-01 │ ● Online │ Production │││ │ acme-web-02 │ ● Online │ Production │││ │ acme-api-01 │ ● Online │ Staging │││ │ acme-db-01 │ ● Online │ Production │││ └────────────────┴──────────┴────────────────────────────┘││ │└─────────────────────────────────────────────────────────────┘Deployments
Section titled “Deployments”Only deployments for the current tenant are shown:
┌─────────────────────────────────────────────────────────────┐│ Deployments - Acme Corp │├─────────────────────────────────────────────────────────────┤│ ││ ┌────────────┬─────────┬────────────┬──────────┬────────┐ ││ │ Solution │ Version │ Environment│ Status │ Time │ ││ ├────────────┼─────────┼────────────┼──────────┼────────┤ ││ │ portal │ 1.4.0 │ Production │ ✓ Done │ 10m │ ││ │ auth │ 2.1.0 │ Staging │ ✓ Done │ 1h │ ││ │ portal │ 1.3.0 │ Staging │ ✓ Done │ 2d │ ││ └────────────┴─────────┴────────────┴──────────┴────────┘ ││ │└─────────────────────────────────────────────────────────────┘Default Selections
Section titled “Default Selections”When creating a new deployment, the tenant field is pre-filled from the active context:
┌─────────────────────────────────────────────────────────────┐│ New Deployment │├─────────────────────────────────────────────────────────────┤│ ││ Tenant: [Acme Corp ▼] (from context) ││ Solution: [Select solution... ▼] ││ Version: [Select version... ▼] ││ Environment: [Select environment ▼] ││ ││ ┌───────────────────────────────────────────────────────┐ ││ │ Tenant pre-selected from current context. │ ││ │ Change if deploying to a different tenant. │ ││ └───────────────────────────────────────────────────────┘ ││ │└─────────────────────────────────────────────────────────────┘All Tenants View
Section titled “All Tenants View”Select All Tenants (no filter) to remove the tenant context and see resources across all tenants. For single-tenant resource lists — solutions, sequences, actions, deployments, and environments — a Tenant column appears naming each row’s owning tenant (“Global” if the resource is not scoped to a specific tenant).
┌─────────────────────────────────────────────────────────────┐│ Deployments - All Tenants │├─────────────────────────────────────────────────────────────┤│ ││ ┌────────────┬─────────┬────────────────┬──────────────┐ ││ │ Solution │ Version │ Tenant │ Status │ ││ ├────────────┼─────────┼────────────────┼──────────────┤ ││ │ portal │ 1.4.0 │ Acme Corp │ ✓ Done │ ││ │ auth │ 2.1.0 │ Beta Inc │ ✓ Done │ ││ │ worker │ 3.0.0 │ Gamma LLC │ ⟳ Running │ ││ │ base-cfg │ 1.0.0 │ Global │ ✓ Done │ ││ └────────────┴─────────┴────────────────┴──────────────┘ ││ │└─────────────────────────────────────────────────────────────┘The Tenant column is present in the All Tenants view for solutions, sequences, actions, deployments, and environments. Targets and storage do not yet show this column.
Context Persistence
Section titled “Context Persistence”Session-Based
Section titled “Session-Based”The active tenant is stored in a session cookie (mantis_active_tenant):
| Action | Context Effect |
|---|---|
| Page refresh | Retained |
| Navigate away | Retained |
| New tab | Inherited |
| Browser close | Cleared |
Favorites and Recents are stored in localStorage (per-user, per-browser) and survive browser restarts.
URL Parameters
Section titled “URL Parameters”A ?tenant=<id> query parameter scopes a view to that tenant without writing the cookie. The active context reverts to the cookie value as soon as you navigate to a URL without the parameter:
https://lens.example.com/deployments?tenant=01890a5d-ac96-774b-b001-2f08e3f1c4d2This is useful for sharing a tenant-filtered view without changing the recipient’s persistent context.
Best Practices
Section titled “Best Practices”1. Set Context for Focused Work
Section titled “1. Set Context for Focused Work”When working on one tenant:
- Set context at start of session
- Complete all tenant-related tasks
- Clear or switch context when done
2. Use All Tenants for Overview
Section titled “2. Use All Tenants for Overview”For administrative tasks:
- Reviewing overall health
- Comparing versions across tenants
- Bulk operations
3. Verify Before Critical Operations
Section titled “3. Verify Before Critical Operations”Before deployments or changes:
┌─────────────────────────────────────────────────────────────┐│ Confirm Deployment │├─────────────────────────────────────────────────────────────┤│ ││ ⚠ Please verify: ││ ││ Tenant: Acme Corp ││ Solution: customer-portal ││ Version: 1.4.0 ││ Environment: Production ││ ││ This will deploy to 8 targets. ││ ││ [Cancel] [Deploy] ││ │└─────────────────────────────────────────────────────────────┘Troubleshooting
Section titled “Troubleshooting””No targets found” with Context Set
Section titled “”No targets found” with Context Set”Cause: Tenant has no assigned targets
Solution: Assign targets to the tenant or clear context
Cannot See Expected Deployments
Section titled “Cannot See Expected Deployments”Cause: Context filtering hides other tenants’ data
Solution: Clear context or select All Tenants
Context Resets Unexpectedly
Section titled “Context Resets Unexpectedly”Cause: Session cookie cleared (browser closed or cookies purged)
Solution: Re-authenticate and set context again
Next Steps
Section titled “Next Steps”- Tenant Variables - Configure tenant-specific values
- Switching Tenants - Change tenant context
- Overview - Return to tenants overview
