1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-22 02:51:33 +01:00

EC-262 - add missing validation on deactivate (#2064)

This commit is contained in:
Chad Scharf 2022-06-17 11:04:25 -04:00 committed by GitHub
parent 3360d40592
commit ee5946c4b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.");