ownership
This commit is contained in:
parent
72fb6fbc20
commit
e2b46becf0
13 changed files with 79 additions and 13 deletions
|
@ -124,23 +124,17 @@ export async function finishInvite(req: Request, res: Response, grantAdmin: bool
|
|||
lastname: lastname,
|
||||
mail: mail,
|
||||
secret: secret,
|
||||
isOwner: grantAdmin,
|
||||
};
|
||||
let id = await UserCommandHandler.create(createUser);
|
||||
|
||||
if (grantAdmin) {
|
||||
let createPermission: CreateUserPermissionCommand = {
|
||||
permission: "*",
|
||||
userId: id,
|
||||
};
|
||||
await UserPermissionCommandHandler.create(createPermission);
|
||||
}
|
||||
|
||||
let jwtData: JWTToken = {
|
||||
userId: id,
|
||||
mail: mail,
|
||||
username: username,
|
||||
firstname: firstname,
|
||||
lastname: lastname,
|
||||
isOwner: grantAdmin,
|
||||
permissions: {
|
||||
...(grantAdmin ? { admin: true } : {}),
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue