mirror of
https://github.com/bitwarden/server
synced 2026-01-20 09:23:28 +00:00
[PM-21727] Add feature to plan and license constructor (#5834)
* add feature to plan * add license to ctor for old license file creation method
This commit is contained in:
@@ -84,6 +84,7 @@ public class OrganizationLicense : ILicense
|
||||
SmSeats = org.SmSeats;
|
||||
SmServiceAccounts = org.SmServiceAccounts;
|
||||
UseRiskInsights = org.UseRiskInsights;
|
||||
UseOrganizationDomains = org.UseOrganizationDomains;
|
||||
|
||||
// Deprecated. Left for backwards compatibility with old license versions.
|
||||
LimitCollectionCreationDeletion = org.LimitCollectionCreation || org.LimitCollectionDeletion;
|
||||
@@ -195,10 +196,10 @@ public class OrganizationLicense : ILicense
|
||||
/// <remarks>Intentionally set one version behind to allow self hosted users some time to update before
|
||||
/// getting out of date license errors
|
||||
/// </remarks>
|
||||
public const int CurrentLicenseFileVersion = 14;
|
||||
public const int CurrentLicenseFileVersion = 15;
|
||||
private bool ValidLicenseVersion
|
||||
{
|
||||
get => Version is >= 1 and <= 15;
|
||||
get => Version is >= 1 and <= 16;
|
||||
}
|
||||
|
||||
public byte[] GetDataBytes(bool forHash = false)
|
||||
@@ -244,6 +245,8 @@ public class OrganizationLicense : ILicense
|
||||
(Version >= 14 || !p.Name.Equals(nameof(LimitCollectionCreationDeletion))) &&
|
||||
// AllowAdminAccessToAllCollectionItems was added in Version 15
|
||||
(Version >= 15 || !p.Name.Equals(nameof(AllowAdminAccessToAllCollectionItems))) &&
|
||||
// UseOrganizationDomains was added in Version 16
|
||||
(Version >= 16 || !p.Name.Equals(nameof(UseOrganizationDomains))) &&
|
||||
(
|
||||
!forHash ||
|
||||
(
|
||||
@@ -583,6 +586,11 @@ public class OrganizationLicense : ILicense
|
||||
* validation.
|
||||
*/
|
||||
|
||||
if (valid && Version >= 16)
|
||||
{
|
||||
valid = organization.UseOrganizationDomains;
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user