mirror of
https://github.com/bitwarden/server
synced 2025-12-15 07:43:54 +00:00
* Add feature flag * Promoted the new Entiy Framework properties * Deprecate the old property * Update references * Fix mispelling * Re-add contextual comment regarding dropped license properties * Add back deleted assertion for deprecated property * Add back removed fixture property assignment * Improve feature toggling scenerios for self hosted org creation/update * Unblock `PutCollectionManagement` for self host * Simplify logic of a couple of conditionals * Feature toggle route unblocking * Adjust logic collection creation/deletion authorization handler * Create tests * Fix bug caught by tests * Fix bugs caught during manual testing * Remove remark about license
31 lines
1.2 KiB
C#
31 lines
1.2 KiB
C#
using Bit.Core;
|
|
using Bit.Core.AdminConsole.Entities;
|
|
using Bit.Core.Services;
|
|
|
|
namespace Bit.Api.Models.Request.Organizations;
|
|
|
|
public class OrganizationCollectionManagementUpdateRequestModel
|
|
{
|
|
public bool LimitCollectionCreation { get; set; }
|
|
public bool LimitCollectionDeletion { get; set; }
|
|
// Deprecated: https://bitwarden.atlassian.net/browse/PM-10863
|
|
public bool LimitCreateDeleteOwnerAdmin { get; set; }
|
|
public bool AllowAdminAccessToAllCollectionItems { get; set; }
|
|
|
|
public virtual Organization ToOrganization(Organization existingOrganization, IFeatureService featureService)
|
|
{
|
|
if (featureService.IsEnabled(FeatureFlagKeys.LimitCollectionCreationDeletionSplit))
|
|
{
|
|
existingOrganization.LimitCollectionCreation = LimitCollectionCreation;
|
|
existingOrganization.LimitCollectionDeletion = LimitCollectionDeletion;
|
|
}
|
|
else
|
|
{
|
|
existingOrganization.LimitCollectionCreationDeletion = LimitCreateDeleteOwnerAdmin || LimitCollectionCreation || LimitCollectionDeletion;
|
|
}
|
|
|
|
existingOrganization.AllowAdminAccessToAllCollectionItems = AllowAdminAccessToAllCollectionItems;
|
|
return existingOrganization;
|
|
}
|
|
}
|