mirror of
https://github.com/bitwarden/server.git
synced 2024-11-21 12:05:42 +01:00
[AC-1163] Manage users permissions should allow collection assignment (#2808)
* [AC-1163] Update ViewAllCollections method to include check for ManagerUsers permission Users with ManagerUsers permission need to be able to view all collections in order to assign them to other users. * [AC-1163] Revert change to CurrentContext * [AC-1163] Add check for ManageUsers to list collections endpoint
This commit is contained in:
parent
27e75e4459
commit
cc4b6bb2fa
@ -87,7 +87,7 @@ public class CollectionsController : Controller
|
||||
// We always need to know which collections the current user is assigned to
|
||||
var assignedOrgCollections = await _collectionRepository.GetManyByUserIdWithAccessAsync(_currentContext.UserId.Value, orgId);
|
||||
|
||||
if (await _currentContext.ViewAllCollections(orgId))
|
||||
if (await _currentContext.ViewAllCollections(orgId) || await _currentContext.ManageUsers(orgId))
|
||||
{
|
||||
// The user can view all collections, but they may not always be assigned to all of them
|
||||
var allOrgCollections = await _collectionRepository.GetManyByOrganizationIdWithAccessAsync(orgId);
|
||||
|
Loading…
Reference in New Issue
Block a user