multi-tenancy / namespace feature
Is your feature request related to a problem? Please describe.
I would like to allow distinct users to manage distinct entities without to access other ones entitites.
Example taken from my comment https://github.com/knadh/listmonk/issues/2752#issuecomment-3552720981
I have 2 users, each being in charge of email campaigns for his product. Lets say user A and user B
- user A should see lists, campaigns, subscribers associated to a product A
- user B should see lists, campaigns, subscribers associated to a product B
But each user must never access other's user entities:
- user A show know nothing about B
- user B show know nothing about A
This is something like namespaces - a simplified version of multi-tenancy
Describe the solution you'd like
A way to implement this would be the following:
- allow to manage a list of namespaces (for superadmin only)
- associate to each SQL table a column namespace which links to the associated namespace or is empty
- associate a user to one namespaces
When dealing with SQL queries:,
- all read queries would add a
where namespace = xxx - all write queries would add a
set namespace = xxx
where xxx is the namespace of the current user.
This allow a simplified implementation of multi-tenancy.
I did look at the source code, I feel like
- the only real modification would be in
queries.sqlby adding thenamespacecolumn related parts - it would be set from current operating user (I did not find where it is set)
- I can help with backend code
- I can't with frontend
What do you think?
This would help with:
- #2395
- #2752 (this is not the same but @PhilippeAccorsi and I would be happy with this implementation)
- use listmonk instead of mailtrain as the core-software of clients-oriented emailing service
Have you tried whether Roles -> List permissions (which is basically a namespace of multiple lists) to achieve this?