Remove siteIds and build associations from user role chnages

This commit is contained in:
Owen
2025-11-06 17:59:34 -08:00
parent bea1c65076
commit ec1f94791a
9 changed files with 669 additions and 459 deletions

View File

@@ -388,6 +388,11 @@ async function getOrCreateOrgClient(
clientId: newClient.clientId
});
await trx.insert(userClients).values({ // we also want to make sure that the user can see their own client if they are not an admin
userId,
clientId: newClient.clientId
});
if (userOrg.roleId != adminRole.roleId) {
// make sure the user can access the client
trx.insert(userClients).values({