1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 16:42:50 -05:00

fix: set orgUser Id for collection access when creating reseller org, refs AC-2214 (#3839)

This commit is contained in:
Vincent Salucci
2024-02-25 17:00:34 -06:00
committed by GitHub
parent 4ae86b7d34
commit 8fb64f036c
3 changed files with 4 additions and 5 deletions

View File

@ -2526,7 +2526,7 @@ public class OrganizationService : IOrganizationService
});
}
public async Task InitPendingOrganization(Guid userId, Guid organizationId, string publicKey, string privateKey, string collectionName)
public async Task InitPendingOrganization(Guid userId, Guid organizationId, Guid organizationUserId, string publicKey, string privateKey, string collectionName)
{
await ValidateSignUpPoliciesAsync(userId);
@ -2565,9 +2565,8 @@ public class OrganizationService : IOrganizationService
List<CollectionAccessSelection> defaultOwnerAccess = null;
if (org.FlexibleCollections)
{
var orgUser = await _organizationUserRepository.GetByOrganizationAsync(org.Id, userId);
defaultOwnerAccess =
[new CollectionAccessSelection { Id = orgUser.Id, HidePasswords = false, ReadOnly = false, Manage = true }];
[new CollectionAccessSelection { Id = organizationUserId, HidePasswords = false, ReadOnly = false, Manage = true }];
}
var defaultCollection = new Collection