bernardopires/django-tenant-schemas — pull request #161 by bjk17 (2014-07-09 12:25:29+00:00)
Title: Working example of semi-public schemas.

Semi-public schemas
=================

This is a patch to add support for semi-public schemas to the django-tenant-schemas app. It may not be the most elegant solution and there is a to-do list before implementing this in the master branch. I modified the TenantMixin model to add the column 'additional_schemas' which is a string that will be added to PostgreSQL's search_path when queries are executed. This feature means that when implementing django-tenant-schemas add-on to legacy databases with data in schemas one can choose what tenants have access to those schemas on a database-level, isolating the data from tenant who should not have access to it.

To-Do
--------
*Add code to tenant-schemas/models.py save() function which detects schema name collision i.e. data-leaks (Example: tenants named tenant1 and tenant2, make sure that tenant2's additional_schemas string does not include the schema 'tenant1')