Move new sproc to separate PR

This commit is contained in:
Thomas Rittson
2025-12-27 12:54:06 +10:00
parent 1f931bd615
commit ce7d727a9c
11 changed files with 60 additions and 412 deletions

View File

@@ -12,6 +12,7 @@ using Bit.Core.Billing.Enums;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Exceptions;
using Bit.Core.Models.Data;
using Bit.Core.Platform.Push;
using Bit.Core.Repositories;
using Bit.Core.Services;
@@ -296,10 +297,22 @@ public class ConfirmOrganizationUserCommand : IConfirmOrganizationUserCommand
return;
}
await _collectionRepository.UpsertDefaultCollectionAsync(
organizationUser.OrganizationId,
organizationUser.Id,
defaultUserCollectionName);
var defaultCollection = new Collection
{
OrganizationId = organizationUser.OrganizationId,
Name = defaultUserCollectionName,
Type = CollectionType.DefaultUserCollection,
DefaultCollectionOwnerId = organizationUser.Id
};
var collectionUser = new CollectionAccessSelection
{
Id = organizationUser.Id,
ReadOnly = false,
HidePasswords = false,
Manage = true
};
await _collectionRepository.CreateAsync(defaultCollection, groups: null, users: [collectionUser]);
}
/// <summary>