check right on sendActivationEmail

This commit is contained in:
Ulf Gebhardt 2022-02-01 02:59:19 +01:00
parent 2fc4c9c341
commit 654dd8de96
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
2 changed files with 3 additions and 0 deletions

View File

@ -26,4 +26,5 @@ export enum RIGHTS {
SEARCH_PENDING_CREATION = 'SEARCH_PENDING_CREATION',
DELETE_PENDING_CREATION = 'DELETE_PENDING_CREATION',
CONFIRM_PENDING_CREATION = 'CONFIRM_PENDING_CREATION',
SEND_ACTIVATION_EMAIL = 'SEND_ACTIVATION_EMAIL',
}

View File

@ -476,6 +476,8 @@ export class UserResolver {
return 'success'
}
// THis is used by the admin only - should we move it to the admin resolver?
@Authorized([RIGHTS.SEND_ACTIVATION_EMAIL])
@Mutation(() => Boolean)
async sendActivationEmail(@Arg('email') email: string): Promise<boolean> {
const loginUserRepository = getCustomRepository(LoginUserRepository)