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