Skip to content

Commit

Permalink
Merge pull request #15212 from Budibase/cheeks-fixes
Browse files Browse the repository at this point in the history
Fix onboarding users
  • Loading branch information
aptkingston authored Dec 18, 2024
2 parents 7bd9151 + adc0d78 commit 6d65da0
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,20 +368,22 @@
const payload = [
{
email: newUserEmail,
builder: {
global: creationRoleType === Constants.BudibaseRoles.Admin,
creator: creationRoleType === Constants.BudibaseRoles.Creator,
userInfo: {
builder: {
global: creationRoleType === Constants.BudibaseRoles.Admin,
creator: creationRoleType === Constants.BudibaseRoles.Creator,
},
admin: { global: creationRoleType === Constants.BudibaseRoles.Admin },
},
admin: { global: creationRoleType === Constants.BudibaseRoles.Admin },
},
]
const notCreatingAdmin = creationRoleType !== Constants.BudibaseRoles.Admin
const isCreator = creationAccessType === Constants.Roles.CREATOR
if (notCreatingAdmin && isCreator) {
payload[0].builder.apps = [prodAppId]
payload[0].userInfo.builder.apps = [prodAppId]
} else if (notCreatingAdmin && !isCreator) {
payload[0].apps = { [prodAppId]: creationAccessType }
payload[0].userInfo.apps = { [prodAppId]: creationAccessType }
}
let userInviteResponse
Expand Down

0 comments on commit 6d65da0

Please sign in to comment.