joas8211 / payload-tenancy

Multi-tenancy plugin for Payload CMS
MIT License
150 stars 11 forks source link

Feature: Add multi-segment path support for tenant isolation #44

Open kapilbarad opened 3 months ago

kapilbarad commented 3 months ago

Feature

I would love to use this plugin to be able to separate the tenants based on path, but my requirement includes multiple path segments and not just one. Can we have an option to provide the number of segments to be used while identifying a tenant?

Example Tenant URL: http://localhost/parent/child/admin

Proposed Solution:

tenancy({
  tenantCollection: 'tenants',
  isolationStrategy: 'path',
  pathSegmentCount: 2, // Optional. Default: 1
})

CC: @joas8211 @balinthaller