-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PM-11406] Account Management: Prevent a verified user from deleting their account #49
base: ac/pm-11405/prevent-a-verified-user-from-changing-their-email-address
Are you sure you want to change the base?
Conversation
…Deprovisioning is enabled
- Added CannotDeleteManagedAccountViewModel class to handle emails related to preventing deletion of accounts managed by an organization. - Added HTML and text email templates for sending notifications about the inability to delete an account owned by an organization. - Updated IMailService interface with a new method to send the cannot delete managed account email. - Implemented the SendCannotDeleteManagedAccountEmailAsync method in HandlebarsMailService. - Added a check in UserService to send the cannot delete managed account email if the user is managed by any organization. - Added a no-op implementation for SendCannotDeleteManagedAccountEmailAsync in NoopMailService.
…-email-address' into ac/pm-11406/prevent-a-verified-user-from-deleting-their-account
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile
@@ -18,6 +18,7 @@ Task SendTrialInitiationSignupEmailAsync( | |||
ProductTierType productTier, | |||
IEnumerable<ProductType> products); | |||
Task SendVerifyDeleteEmailAsync(string email, Guid userId, string token); | |||
Task SendCannotDeleteManagedAccountEmailAsync(string email); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: consider adding XML documentation for this new method
public Task SendCannotDeleteManagedAccountEmailAsync(string email) | ||
{ | ||
return Task.FromResult(0); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider adding XML documentation for this new method to maintain consistency with other methods in the class.
_featureService.IsEnabled(FeatureFlagKeys.AccountDeprovisioning).Returns(true); | ||
_userService.IsManagedByAnyOrganizationAsync(user.Id).Returns(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider using a constant or enum for the feature flag key instead of a string literal
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-11406
📔 Objective
📸 Screenshots
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changesGreptile Summary
This pull request implements changes to prevent verified users managed by an organization from deleting their accounts and updates the email notification system accordingly.
AccountsController.Delete
to block account deletion for organization-managed usersCannotDeleteManagedAccountViewModel
and corresponding HTML/text email templatesSendCannotDeleteManagedAccountEmailAsync
method toIMailService
and its implementationsUserService.SendDeleteConfirmationAsync
to handle managed user scenariosAccountsControllerTests
to verify deletion prevention logic