Merge branch 'master' into fix-ds-validity-checking

This commit is contained in:
Andrew Kingston 2024-12-18 16:54:16 +00:00 committed by GitHub
commit a0eecd7e1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 6 deletions

View File

@ -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