Merge pull request #15212 from Budibase/cheeks-fixes
Fix onboarding users
This commit is contained in:
commit
6d65da0d51
|
@ -368,20 +368,22 @@
|
||||||
const payload = [
|
const payload = [
|
||||||
{
|
{
|
||||||
email: newUserEmail,
|
email: newUserEmail,
|
||||||
builder: {
|
userInfo: {
|
||||||
global: creationRoleType === Constants.BudibaseRoles.Admin,
|
builder: {
|
||||||
creator: creationRoleType === Constants.BudibaseRoles.Creator,
|
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 notCreatingAdmin = creationRoleType !== Constants.BudibaseRoles.Admin
|
||||||
const isCreator = creationAccessType === Constants.Roles.CREATOR
|
const isCreator = creationAccessType === Constants.Roles.CREATOR
|
||||||
if (notCreatingAdmin && isCreator) {
|
if (notCreatingAdmin && isCreator) {
|
||||||
payload[0].builder.apps = [prodAppId]
|
payload[0].userInfo.builder.apps = [prodAppId]
|
||||||
} else if (notCreatingAdmin && !isCreator) {
|
} else if (notCreatingAdmin && !isCreator) {
|
||||||
payload[0].apps = { [prodAppId]: creationAccessType }
|
payload[0].userInfo.apps = { [prodAppId]: creationAccessType }
|
||||||
}
|
}
|
||||||
|
|
||||||
let userInviteResponse
|
let userInviteResponse
|
||||||
|
|
Loading…
Reference in New Issue