Skip to content

Commit

Permalink
Merge pull request 'feature/license-feature-branding' (#35) from feat…
Browse files Browse the repository at this point in the history
…ure/license-feature-branding into develop

Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/DocSpace-server/pulls/35
Reviewed-by: pavelbannov <[email protected]>
  • Loading branch information
AlexeySafronov committed Oct 3, 2024
2 parents 4f8ff45 + 7cc1635 commit 100b9d1
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions common/ASC.Core.Common/Billing/License/License.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public class License
/// <type>System.String, System</type>
public string OriginalLicense { get; set; }

/// <summary>Specifies if the license supports branding or not</summary>
/// <type>System.Boolean, System</type>
public bool Branding { get; set; }

/// <summary>Specifies if the license is customizable or not</summary>
/// <type>System.Boolean, System</type>
public bool Customization { get; set; }
Expand Down
1 change: 1 addition & 0 deletions common/ASC.Core.Common/Billing/License/LicenseReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ private async Task LicenseToDBAsync(License license)
ContentSearch = true,
MaxFileSize = defaultQuota.MaxFileSize,
DocsEdition = true,
Branding = license.Branding,
Customization = license.Customization,
Lifetime = !license.TimeLimited,
Statistic = true
Expand Down
12 changes: 12 additions & 0 deletions common/ASC.Core.Common/Tenants/TenantQuota.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,16 @@ public bool Statistic
set => _statisticFeature.Value = value;
}

private readonly TenantQuotaFeatureFlag _brandingFeature;

/// <summary>Specifies if the branding settings are available or not</summary>
/// <type>System.Boolean, System</type>
public bool Branding
{
get => _brandingFeature.Value;
set => _brandingFeature.Value = value;
}

private readonly TenantQuotaFeatureFlag _customizationFeature;

/// <summary>Specifies if the customization settings are available or not</summary>
Expand Down Expand Up @@ -324,6 +334,7 @@ public TenantQuota()
_docsEditionFeature = new TenantQuotaFeatureFlag(this) { Name = "docs", Visible = false };
_ldapFeature = new TenantQuotaFeatureFlag(this) { Name = "ldap", Order = 3 };
_ssoFeature = new TenantQuotaFeatureFlag(this) { Name = "sso", Order = 5 };
_brandingFeature = new TenantQuotaFeatureFlag(this) { Name = "branding", Visible = false };
_customizationFeature = new TenantQuotaFeatureFlag(this) { Name = "customization", Order = 4 };
_lifetimeFeature = new TenantQuotaFeatureFlag(this) { Name = "lifetime", Standalone = true };
_customFeature = new TenantQuotaFeatureFlag(this) { Name = "custom", Visible = false };
Expand All @@ -349,6 +360,7 @@ public TenantQuota()
_docsEditionFeature,
_ldapFeature,
_ssoFeature,
_brandingFeature,
_customizationFeature,
_lifetimeFeature,
_customFeature,
Expand Down
3 changes: 2 additions & 1 deletion web/ASC.Web.Api/Api/Settings/SettingsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ public async Task<SettingsDto> GetSettingsAsync(bool? withpassword)
LicenseUrl = setupInfo.LicenseUrl,
CookieSettingsEnabled = tenantCookieSettings.Enabled,
UserNameRegex = userFormatter.UserNameRegex.ToString(),
ForumLink = await commonLinkUtility.GetUserForumLinkAsync(settingsManager)
ForumLink = await commonLinkUtility.GetUserForumLinkAsync(settingsManager),
DisplayAbout = (!coreBaseSettings.Standalone && !coreBaseSettings.CustomMode) || !(await tenantManager.GetCurrentTenantQuotaAsync()).Branding
};

if (!authContext.IsAuthenticated && await externalShare.GetLinkIdAsync() != default)
Expand Down
4 changes: 4 additions & 0 deletions web/ASC.Web.Api/ApiModels/ResponseDto/SettingsDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ public class SettingsDto
/// <type>System.String, System</type>
public string ForumLink { get; set; }

/// <summary>Specifies whether to display the About section</summary>
/// <type>System.Boolean, System</type>
public bool DisplayAbout { get; set; }

/// <summary>API documentation link</summary>
/// <type>System.String, System</type>
public string ApiDocsLink { get; set; }
Expand Down

0 comments on commit 100b9d1

Please sign in to comment.