mirror of
https://github.com/bitwarden/server.git
synced 2025-03-14 13:49:30 +01:00
Fix bulk api (#1335)
This commit is contained in:
parent
785e788cb6
commit
2b6c5bcd31
@ -1539,7 +1539,7 @@ namespace Bit.Core.Services
|
||||
}
|
||||
|
||||
var owners = filteredUsers.Where(u => u.Type == OrganizationUserType.Owner);
|
||||
if (!owners.Any() && deletingUserId.HasValue && !await UserIsOwnerAsync(organizationId, deletingUserId.Value))
|
||||
if (owners.Any() && deletingUserId.HasValue && !await UserIsOwnerAsync(organizationId, deletingUserId.Value))
|
||||
{
|
||||
throw new BadRequestException("Only owners can delete other owners.");
|
||||
}
|
||||
|
@ -462,6 +462,7 @@ namespace Bit.Core.Test.Services
|
||||
var organizationUserRepository = sutProvider.GetDependency<IOrganizationUserRepository>();
|
||||
|
||||
deletingUser.Type = OrganizationUserType.Admin;
|
||||
orgUser1.Type = OrganizationUserType.Owner;
|
||||
orgUser1.OrganizationId = orgUser2.OrganizationId = deletingUser.OrganizationId;
|
||||
var organizationUsers = new[] { orgUser1, orgUser2 };
|
||||
var organizationUserIds = organizationUsers.Select(u => u.Id);
|
||||
|
Loading…
Reference in New Issue
Block a user