From 0f5478707233d820f361a8ea0a95c81717f67d73 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 15 Nov 2021 16:46:56 +0000 Subject: [PATCH] Adding role, as it wasn't being set in metadata. --- packages/server/src/api/controllers/user.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/server/src/api/controllers/user.js b/packages/server/src/api/controllers/user.js index 4461cbfe24..6dfaf9847d 100644 --- a/packages/server/src/api/controllers/user.js +++ b/packages/server/src/api/controllers/user.js @@ -97,6 +97,7 @@ exports.syncUser = async function (ctx) { .map(([appId]) => appId) } for (let prodAppId of prodAppIds) { + const roleId = roles[prodAppId] const devAppId = getDevelopmentAppID(prodAppId) for (let appId of [prodAppId, devAppId]) { if (!(await doesDatabaseExist(appId))) { @@ -115,6 +116,10 @@ exports.syncUser = async function (ctx) { tableId: InternalTables.USER_METADATA, } } + // assign the roleId for the metadata doc + if (roleId) { + metadata.roleId = roleId + } let combined = !deleting ? combineMetadataAndUser(user, metadata) : {