Hello, I will try to provide some answers and thoughts.
In general, multitenancy means that the same application and database can be used by different organisations, without seeing each other’s data, unless you define that they can.
With this specific multitenancy add-on, https://docs.jmix.io/jmix/multitenancy/index.html, you have the system filtering entities for you, if they have tenant id annotation, which in turn will have tenant id field in relevant database tables.
However you need to know what you are doing because it works for entities only, not for direct SQL
“so tenant users should not have access to any functionality that provides access to native SQL or Groovy code” - BPM has a script feature with Groovy for example.
Your requirement “tenant |—<| customer |—<| client” is not directly covered with this, as it has tenant-user, one level short. Multitenancy is just a blanket filter, not a replacement for roles.
I think that you don’t really need multitenancy, you first need to create a CRUD matrix
http://www.unified-am.com/UAM/UAM/guidances/guidelines/uam_crud-matrix_F56BDB11.html?proc=_M6m4MchNEdyU89e0dKAsrw&path=_M6m4MchNEdyU89e0dKAsrw,_tBZcMMhSEdyU89e0dKAsrw,_x-13cN8YEdynr9jlfK-aMA,_2xGNwHpfEeSeFZYfCAsIPg
it can be done in excel or google sheets no fancy tools needed really. Possibly also capture the process and activities, and then make a process diagram, a diagonalized CRUD matrix for process-entity, not just role-entity.
Then, define the roles Security :: Jmix Documentation and then build UI as needed - it may be that different roles will have slightly different UI views based on what they need to do - don’t be afraid to just copy-paste and modify like in old VB if its easier to have control of and brings less complexity, you don’t need to make several layers of inheritance just for the sake of it.
“We find it strange to having to set an input like tenantName|userName” - several different tenants can have a user with the same username. Since usernames are supposed to be “separate” for each tenant, you need to provide the tenant id, possibly customize the login screen to have a combo box, or provide different login screens for different tenants that would then be tenant-specific. Otherwise, for example, you admit to one tenant’s users to know a username from another tenant and then you get a huge minus during a security audit.
This all depends on your use-case, however.
Kind regards,
Mladen