Skip to content

Commit

Permalink
Demote entity propert to an EF shadow property
Browse files Browse the repository at this point in the history
  • Loading branch information
addisonbeck committed Sep 27, 2024
1 parent 75d5dde commit 8f0193c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/Core/AdminConsole/Entities/Organization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,6 @@ public class Organization : ITableObject<Guid>, IStorableSubscriber, IRevisable,
/// </summary>
public bool LimitCollectionCreation { get; set; }
public bool LimitCollectionDeletion { get; set; }
// Deprecated by https://bitwarden.atlassian.net/browse/PM-10863. This
// was replaced with `LimitCollectionCreation` and
// `LimitCollectionDeletion`.
public bool LimitCollectionCreationDeletion
{
get => LimitCollectionCreation || LimitCollectionDeletion;
set
{
LimitCollectionCreation = value;
LimitCollectionDeletion = value;
}
}

/// <summary>
/// If set to true, admins, owners, and some custom users can read/write all collections and items in the Admin Console.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ namespace Bit.Infrastructure.EntityFramework.AdminConsole.Models;

public class Organization : Core.AdminConsole.Entities.Organization
{
// Deprecated by https://bitwarden.atlassian.net/browse/PM-10863. This
// was replaced with `LimitCollectionCreation` and
// `LimitCollectionDeletion`.
public bool LimitCollectionCreationDeletion
{
get => LimitCollectionCreation || LimitCollectionDeletion;
set
{
LimitCollectionCreation = value;
LimitCollectionDeletion = value;
}
}
public virtual ICollection<Cipher> Ciphers { get; set; }
public virtual ICollection<OrganizationUser> OrganizationUsers { get; set; }
public virtual ICollection<Group> Groups { get; set; }
Expand Down Expand Up @@ -38,6 +50,7 @@ public OrganizationMapperProfile()
.ForMember(org => org.ApiKeys, opt => opt.Ignore())
.ForMember(org => org.Connections, opt => opt.Ignore())
.ForMember(org => org.Domains, opt => opt.Ignore())
.ForMember(org => org.LimitCollectionCreationDeletion, opt => opt.Ignore())
.ReverseMap();

CreateProjection<Organization, SelfHostedOrganizationDetails>()
Expand Down

0 comments on commit 8f0193c

Please sign in to comment.