Ensure adding a user as an app builder sets their role to creator

This commit is contained in:
Andrew Kingston 2023-11-24 15:54:46 +00:00
parent 302f6f6106
commit a05fc97715
1 changed files with 1 additions and 0 deletions

View File

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