fix(uba,ubcli,ub): MT environments - system users
All changes in this MR are related to correct functioning of multi-tenant environments. All the changes are made in a way to preserve behavior for regular environments "as is" to minimize impact/risks/
The following changes are made:
-
ubcli
, when generates RLS for PostgreSQL (basic underlying mechanism of multi-tenant mode) now support 2 new policies:-
tenantAndSpecialUsers
- to be used byuba_user
-
tenantAndCommonAndSpecialUsers
- to be used byuba_subject
-
-
uba_user
now has validation rules that disallow update operation onroot
andanonymous
in user tenants -
uba_common
module now in theisSuperUser
function, in user tenants check is done against user name, not user ID for "admin" user -
Session.runAsAdmin
function now for user tenants, redirects toSession.runAsUser
with ID of the admin user in that tenant
Edited by Andrii Bezuglyi