You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(plugin-multi-tenant): verify that tenant selector respects access control (#14916)
### What?
Adds an E2E test to verify that `getTenantOptions` properly respects
access control when determining which tenants appear in the tenant
selector. This is a test for functionality added in #14620.
### Why?
The previous PR #14620 that simplified `getTenantOptions` had no tests
and got merged before @JarrodMFlesch confirmed whether it should be
tested.
### How?
1. **Added the `tenantRole` field** to the Users collection's tenants
array with options: `admin` (default) / `member`
2. **Updated Tenants access control** to check for `tenantRole: 'admin'`
- users can only read tenants where they have an admin role
3. **Added test user in seed data** with mixed tenant roles:
- Steel Cat (admin role) → should appear in selector
- Anchor Bar (admin role) → should appear in selector
- Blue Dog (member role) → should NOT appear in selector
4. **Added an E2E test** that logs in as this user and verifies the
tenant selector only shows tenants with read access
The test confirms that `getTenantOptions` respects the tenant
collection's access control configuration and doesn't blindly show all
tenants from the user's array.
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
0 commit comments