Ensure adding a user as an app builder sets their role to creator
This commit is contained in:
parent
302f6f6106
commit
a05fc97715
|
@ -341,6 +341,7 @@ export function cleanseUserObject(user: User | ContextUser, base?: User) {
|
|||
export async function addAppBuilder(user: User, appId: string) {
|
||||
const prodAppId = getProdAppID(appId)
|
||||
user.builder ??= {}
|
||||
user.builder.creator = true
|
||||
user.builder.apps ??= []
|
||||
user.builder.apps.push(prodAppId)
|
||||
await UserDB.save(user, { hashPassword: false })
|
||||
|
|
Loading…
Reference in New Issue