mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
fix(core): Do not allow admins to generate password-reset links for instance owner (#9488)
This commit is contained in:
committed by
GitHub
parent
8f55bb1457
commit
88b9a4070b
@@ -115,6 +115,10 @@ export class UsersController {
|
||||
throw new NotFoundError('User not found');
|
||||
}
|
||||
|
||||
if (req.user.role === 'global:admin' && user.role === 'global:owner') {
|
||||
throw new ForbiddenError('Admin cannot reset password of global owner');
|
||||
}
|
||||
|
||||
const link = this.authService.generatePasswordResetUrl(user);
|
||||
return { link };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user