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 26, 2024
1 parent 2f75262 commit b37502a
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 b37502a

Please sign in to comment.