mirror of
https://github.com/bitwarden/server
synced 2026-01-10 12:33:49 +00:00
[AC-1646] Rename LimitCollectionCdOwnerAdmin column (#3300)
* Rename LimitCollectionCdOwnerAdmin -> LimitCollectionCreationDeletion * Rename and bump migration script
This commit is contained in:
@@ -8,7 +8,7 @@ public class OrganizationCollectionManagementUpdateRequestModel
|
||||
|
||||
public virtual Organization ToOrganization(Organization existingOrganization)
|
||||
{
|
||||
existingOrganization.LimitCollectionCdOwnerAdmin = LimitCreateDeleteOwnerAdmin;
|
||||
existingOrganization.LimitCollectionCreationDeletion = LimitCreateDeleteOwnerAdmin;
|
||||
return existingOrganization;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class OrganizationResponseModel : ResponseModel
|
||||
SmServiceAccounts = organization.SmServiceAccounts;
|
||||
MaxAutoscaleSmSeats = organization.MaxAutoscaleSmSeats;
|
||||
MaxAutoscaleSmServiceAccounts = organization.MaxAutoscaleSmServiceAccounts;
|
||||
LimitCollectionCdOwnerAdmin = organization.LimitCollectionCdOwnerAdmin;
|
||||
LimitCollectionCreationDeletion = organization.LimitCollectionCreationDeletion;
|
||||
}
|
||||
|
||||
public Guid Id { get; set; }
|
||||
@@ -98,7 +98,7 @@ public class OrganizationResponseModel : ResponseModel
|
||||
public int? SmServiceAccounts { get; set; }
|
||||
public int? MaxAutoscaleSmSeats { get; set; }
|
||||
public int? MaxAutoscaleSmServiceAccounts { get; set; }
|
||||
public bool LimitCollectionCdOwnerAdmin { get; set; }
|
||||
public bool LimitCollectionCreationDeletion { get; set; }
|
||||
}
|
||||
|
||||
public class OrganizationSubscriptionResponseModel : OrganizationResponseModel
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ProfileOrganizationResponseModel : ResponseModel
|
||||
FamilySponsorshipToDelete = organization.FamilySponsorshipToDelete;
|
||||
FamilySponsorshipValidUntil = organization.FamilySponsorshipValidUntil;
|
||||
AccessSecretsManager = organization.AccessSecretsManager;
|
||||
LimitCollectionCdOwnerAdmin = organization.LimitCollectionCdOwnerAdmin;
|
||||
LimitCollectionCreationDeletion = organization.LimitCollectionCreationDeletion;
|
||||
|
||||
if (organization.SsoConfig != null)
|
||||
{
|
||||
@@ -114,5 +114,5 @@ public class ProfileOrganizationResponseModel : ResponseModel
|
||||
public DateTime? FamilySponsorshipValidUntil { get; set; }
|
||||
public bool? FamilySponsorshipToDelete { get; set; }
|
||||
public bool AccessSecretsManager { get; set; }
|
||||
public bool LimitCollectionCdOwnerAdmin { get; set; }
|
||||
public bool LimitCollectionCreationDeletion { get; set; }
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class CollectionAuthorizationHandler : BulkAuthorizationHandler<Collectio
|
||||
CurrentContextOrganization org)
|
||||
{
|
||||
// If false, all organization members are allowed to create collections
|
||||
if (!org.LimitCollectionCdOwnerAdmin)
|
||||
if (!org.LimitCollectionCreationDeletion)
|
||||
{
|
||||
context.Succeed(requirement);
|
||||
return;
|
||||
@@ -104,7 +104,7 @@ public class CollectionAuthorizationHandler : BulkAuthorizationHandler<Collectio
|
||||
}
|
||||
|
||||
// The limit collection management setting is enabled and we are not an Admin (above condition), fail
|
||||
if (org.LimitCollectionCdOwnerAdmin)
|
||||
if (org.LimitCollectionCreationDeletion)
|
||||
{
|
||||
context.Fail();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user