kkrajid/django-tenant-authx ? reverse-engineered prompt

Reverse engineered prompt

Build me a Django package for multi tenant SaaS authentication and authorization.

I want it to let one app support many tenants, where each tenant has its own users, roles, and permissions, and people can belong to more than one tenant with different access in each one. It should figure out the current tenant from the domain, subdomain, URL path, or a request header, then make that tenant easy to use in views and API requests.

Please include Django and Django REST Framework support, a simple way to protect pages and API endpoints, and a clean way to check tenant specific permissions in code. Add audit logging for important security events too. Make sure superusers can bypass tenant checks if that fits the default setup, and keep everything focused on tenant isolation so data does not leak between tenants. If you need to look up current docs online while building it, go ahead.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab