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 => {
|
inviteUsers: async users => {
|
||||||
return await API.post({
|
return await API.post({
|
||||||
url: "/api/global/users/multi/invite",
|
url: "/api/global/users/multi/invite",
|
||||||
body: users.map(user => ({
|
body: users.map(user => {
|
||||||
email: user.email,
|
let builder = undefined
|
||||||
userInfo: {
|
if (user.admin || user.builder) {
|
||||||
admin: user.admin ? { global: true } : undefined,
|
builder = { global: true }
|
||||||
builder: user.admin || user.builder ? { global: true } : undefined,
|
} else if (user.creator) {
|
||||||
userGroups: user.groups,
|
builder = { creator: true }
|
||||||
roles: user.apps ? user.apps : undefined,
|
}
|
||||||
},
|
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 = {
|
export const BudibaseRoles = {
|
||||||
AppUser: "appUser",
|
AppUser: "appUser",
|
||||||
Developer: "developer",
|
Developer: "developer",
|
||||||
|
Creator: "creator",
|
||||||
Admin: "admin",
|
Admin: "admin",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,8 +30,9 @@ export const BudibaseRoleOptionsOld = [
|
||||||
{ label: "Admin", value: BudibaseRoles.Admin },
|
{ label: "Admin", value: BudibaseRoles.Admin },
|
||||||
]
|
]
|
||||||
export const BudibaseRoleOptions = [
|
export const BudibaseRoleOptions = [
|
||||||
{ label: "Member", value: BudibaseRoles.AppUser },
|
{ label: "App user", value: BudibaseRoles.AppUser },
|
||||||
{ label: "Admin", value: BudibaseRoles.Admin },
|
{ label: "Creator", value: BudibaseRoles.Creator },
|
||||||
|
{ label: "Account admin", value: BudibaseRoles.Admin },
|
||||||
]
|
]
|
||||||
|
|
||||||
export const BudibaseRoleOptionsNew = [
|
export const BudibaseRoleOptionsNew = [
|
||||||
|
|
Loading…
Reference in New Issue