mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 01:22:50 -05:00
only owners can manage owners
This commit is contained in:
@ -174,6 +174,11 @@ namespace Bit.Api.Controllers
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
||||
if(organizationUser.Type == Core.Enums.OrganizationUserType.Owner && !_currentContext.OrganizationOwner(orgGuidId))
|
||||
{
|
||||
throw new BadRequestException("Only owners can update other owners.");
|
||||
}
|
||||
|
||||
await _organizationUserRepository.UpdateGroupsAsync(organizationUser.Id, model.GroupIds.Select(g => new Guid(g)));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user