mirror of
https://github.com/bitwarden/server.git
synced 2025-04-25 23:02:17 -05:00

* Renamed ManagedUserDomainClaimedEmails to ClaimedUserDomainClaimedEmails * Renamed method to improve clarity and consistency. Replaced `ValidateManagedUserDomainAsync` with `ValidateClaimedUserDomainAsync`. * Rename `GetOrganizationsManagingUserAsync` to `GetOrganizationsClaimingUserAsync`. This renaming clarifies the function's purpose, aligning its name with the concept of "claiming" rather than "managing" user associations. * Refactor variable naming in ValidateClaimedUserDomainAsync * Managed to claimed * Managed to claimed * Managed to claimed * Managing to Claiming * Managing to Claiming * Managing to Claiming * Managing to Claiming * Renamed DeleteManagedOrganizationUserAccountCommand to DeleteClaimedOrganizationUserAccountCommand * Renamed IDeleteManagedOrganizationUserAccountCommand to IDeleteClaimedOrganizationUserAccountCommand * Updated variable name * IsManagedBy to IsClaimedBy * Created new property. obsoleted old property and wired up for backward compatibility. * More Managed to Claimed renames. * Managed to Claimed * Fixing tests... 🤦 * Got the rest of em * missed the test 🤦 * fixed test.
64 lines
2.8 KiB
C#
64 lines
2.8 KiB
C#
using Bit.Api.AdminConsole.Models.Response.Organizations;
|
|
using Bit.Api.Models.Response;
|
|
using Bit.Api.Tools.Models.Response;
|
|
using Bit.Core.AdminConsole.Entities;
|
|
using Bit.Core.AdminConsole.Models.Data.Provider;
|
|
using Bit.Core.Entities;
|
|
using Bit.Core.Models.Api;
|
|
using Bit.Core.Models.Data;
|
|
using Bit.Core.Models.Data.Organizations;
|
|
using Bit.Core.Models.Data.Organizations.OrganizationUsers;
|
|
using Bit.Core.Settings;
|
|
using Bit.Core.Tools.Entities;
|
|
using Bit.Core.Vault.Entities;
|
|
using Bit.Core.Vault.Models.Data;
|
|
|
|
namespace Bit.Api.Vault.Models.Response;
|
|
|
|
public class SyncResponseModel : ResponseModel
|
|
{
|
|
public SyncResponseModel(
|
|
GlobalSettings globalSettings,
|
|
User user,
|
|
bool userTwoFactorEnabled,
|
|
bool userHasPremiumFromOrganization,
|
|
IDictionary<Guid, OrganizationAbility> organizationAbilities,
|
|
IEnumerable<Guid> organizationIdsClaimingingUser,
|
|
IEnumerable<OrganizationUserOrganizationDetails> organizationUserDetails,
|
|
IEnumerable<ProviderUserProviderDetails> providerUserDetails,
|
|
IEnumerable<ProviderUserOrganizationDetails> providerUserOrganizationDetails,
|
|
IEnumerable<Folder> folders,
|
|
IEnumerable<CollectionDetails> collections,
|
|
IEnumerable<CipherDetails> ciphers,
|
|
IDictionary<Guid, IGrouping<Guid, CollectionCipher>> collectionCiphersDict,
|
|
bool excludeDomains,
|
|
IEnumerable<Policy> policies,
|
|
IEnumerable<Send> sends)
|
|
: base("sync")
|
|
{
|
|
Profile = new ProfileResponseModel(user, organizationUserDetails, providerUserDetails,
|
|
providerUserOrganizationDetails, userTwoFactorEnabled, userHasPremiumFromOrganization, organizationIdsClaimingingUser);
|
|
Folders = folders.Select(f => new FolderResponseModel(f));
|
|
Ciphers = ciphers.Select(cipher =>
|
|
new CipherDetailsResponseModel(
|
|
cipher,
|
|
user,
|
|
organizationAbilities,
|
|
globalSettings,
|
|
collectionCiphersDict));
|
|
Collections = collections?.Select(
|
|
c => new CollectionDetailsResponseModel(c)) ?? new List<CollectionDetailsResponseModel>();
|
|
Domains = excludeDomains ? null : new DomainsResponseModel(user, false);
|
|
Policies = policies?.Select(p => new PolicyResponseModel(p)) ?? new List<PolicyResponseModel>();
|
|
Sends = sends.Select(s => new SendResponseModel(s, globalSettings));
|
|
}
|
|
|
|
public ProfileResponseModel Profile { get; set; }
|
|
public IEnumerable<FolderResponseModel> Folders { get; set; }
|
|
public IEnumerable<CollectionDetailsResponseModel> Collections { get; set; }
|
|
public IEnumerable<CipherDetailsResponseModel> Ciphers { get; set; }
|
|
public DomainsResponseModel Domains { get; set; }
|
|
public IEnumerable<PolicyResponseModel> Policies { get; set; }
|
|
public IEnumerable<SendResponseModel> Sends { get; set; }
|
|
}
|