Skip to content

Conversation

@AdrianMaj
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant