Update constants and user invitation API to account for new creator flag
This commit is contained in:
parent
9b99991b2e
commit
35a35f92e6
|
@ -214,15 +214,23 @@ export const buildUserEndpoints = API => ({
|
|||
inviteUsers: async users => {
|
||||
return await API.post({
|
||||
url: "/api/global/users/multi/invite",
|
||||
body: users.map(user => ({
|
||||
email: user.email,
|
||||
userInfo: {
|
||||
admin: user.admin ? { global: true } : undefined,
|
||||
builder: user.admin || user.builder ? { global: true } : undefined,
|
||||
userGroups: user.groups,
|
||||
roles: user.apps ? user.apps : undefined,
|
||||
},
|
||||
})),
|
||||
body: users.map(user => {
|
||||
let builder = undefined
|
||||
if (user.admin || user.builder) {
|
||||
builder = { global: true }
|
||||
} else if (user.creator) {
|
||||
builder = { creator: true }
|
||||
}
|
||||
return {
|
||||
email: user.email,
|
||||
userInfo: {
|
||||
admin: user.admin ? { global: true } : undefined,
|
||||
builder,
|
||||
userGroups: user.groups,
|
||||
roles: user.apps ? user.apps : undefined,
|
||||
},
|
||||
}
|
||||
}),
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ export const TableNames = {
|
|||
export const BudibaseRoles = {
|
||||
AppUser: "appUser",
|
||||
Developer: "developer",
|
||||
Creator: "creator",
|
||||
Admin: "admin",
|
||||
}
|
||||
|
||||
|
@ -29,8 +30,9 @@ export const BudibaseRoleOptionsOld = [
|
|||
{ label: "Admin", value: BudibaseRoles.Admin },
|
||||
]
|
||||
export const BudibaseRoleOptions = [
|
||||
{ label: "Member", value: BudibaseRoles.AppUser },
|
||||
{ label: "Admin", value: BudibaseRoles.Admin },
|
||||
{ label: "App user", value: BudibaseRoles.AppUser },
|
||||
{ label: "Creator", value: BudibaseRoles.Creator },
|
||||
{ label: "Account admin", value: BudibaseRoles.Admin },
|
||||
]
|
||||
|
||||
export const BudibaseRoleOptionsNew = [
|
||||
|
|
Loading…
Reference in New Issue