mirror of
https://github.com/bitwarden/server.git
synced 2025-01-24 22:11:24 +01:00
Let Manage Users permission see group membership (#1135)
This commit is contained in:
parent
f3bff938c4
commit
61ee3f1e45
@ -60,7 +60,8 @@ namespace Bit.Api.Controllers
|
||||
var orgIdGuid = new Guid(orgId);
|
||||
var canAccess = _currentContext.ManageGroups(orgIdGuid) ||
|
||||
_currentContext.ManageAssignedCollections(orgIdGuid) ||
|
||||
_currentContext.ManageAllCollections(orgIdGuid);
|
||||
_currentContext.ManageAllCollections(orgIdGuid) ||
|
||||
_currentContext.ManageUsers(orgIdGuid);
|
||||
|
||||
if (!canAccess)
|
||||
{
|
||||
|
@ -59,7 +59,9 @@ namespace Bit.Api.Controllers
|
||||
public async Task<ListResponseModel<OrganizationUserUserDetailsResponseModel>> Get(string orgId)
|
||||
{
|
||||
var orgGuidId = new Guid(orgId);
|
||||
if (!_currentContext.ManageAssignedCollections(orgGuidId) && !_currentContext.ManageGroups(orgGuidId))
|
||||
if (!_currentContext.ManageAssignedCollections(orgGuidId) &&
|
||||
!_currentContext.ManageGroups(orgGuidId) &&
|
||||
!_currentContext.ManageUsers(orgGuidId))
|
||||
{
|
||||
throw new NotFoundException();
|
||||
}
|
||||
@ -75,7 +77,8 @@ namespace Bit.Api.Controllers
|
||||
public async Task<IEnumerable<string>> GetGroups(string orgId, string id)
|
||||
{
|
||||
var organizationUser = await _organizationUserRepository.GetByIdAsync(new Guid(id));
|
||||
if (organizationUser == null || !_currentContext.ManageGroups(organizationUser.OrganizationId))
|
||||
if (organizationUser == null || (!_currentContext.ManageGroups(organizationUser.OrganizationId) &&
|
||||
!_currentContext.ManageUsers(organizationUser.OrganizationId)))
|
||||
{
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user