mirror of
https://github.com/bitwarden/server
synced 2025-12-15 07:43:54 +00:00
EC-262 - add missing validation on deactivate (#2064)
This commit is contained in:
@@ -2244,6 +2244,11 @@ namespace Bit.Core.Services
|
||||
{
|
||||
try
|
||||
{
|
||||
if (organizationUser.Status == OrganizationUserStatusType.Deactivated)
|
||||
{
|
||||
throw new BadRequestException("Already deactivated.");
|
||||
}
|
||||
|
||||
if (disablingUserId.HasValue && organizationUser.UserId == disablingUserId)
|
||||
{
|
||||
throw new BadRequestException("You cannot deactivate yourself.");
|
||||
|
||||
Reference in New Issue
Block a user