diff --git a/CHANGELOG.md b/CHANGELOG.md
index e8b973b06..1e6ad9bba 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Harmonized the logger output: ()
- Improved the language localization for Italian (`it`)
- Improved the language localization for Dutch (`nl`)
+- Improved the read-only mode
### Fixed
@@ -2950,7 +2951,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Supported the management of additional currencies in the admin control panel
- Introduced the system message
-- Introduced the read only mode
+- Introduced the read-only mode
### Changed
diff --git a/apps/api/src/app/admin/admin.service.ts b/apps/api/src/app/admin/admin.service.ts
index b1b6b9418..a45fbe634 100644
--- a/apps/api/src/app/admin/admin.service.ts
+++ b/apps/api/src/app/admin/admin.service.ts
@@ -8,7 +8,9 @@ import { PropertyService } from '@ghostfolio/api/services/property/property.serv
import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile/symbol-profile.service';
import {
DEFAULT_CURRENCY,
- PROPERTY_CURRENCIES
+ PROPERTY_CURRENCIES,
+ PROPERTY_IS_READ_ONLY_MODE,
+ PROPERTY_IS_USER_SIGNUP_ENABLED
} from '@ghostfolio/common/config';
import {
AdminData,
@@ -305,7 +307,9 @@ export class AdminService {
response = await this.propertyService.delete({ key });
}
- if (key === PROPERTY_CURRENCIES) {
+ if (key === PROPERTY_IS_READ_ONLY_MODE && value === 'true') {
+ await this.putSetting(PROPERTY_IS_USER_SIGNUP_ENABLED, 'false');
+ } else if (key === PROPERTY_CURRENCIES) {
await this.exchangeRateDataService.initialize();
}
diff --git a/apps/client/src/app/pages/pricing/pricing-page.component.ts b/apps/client/src/app/pages/pricing/pricing-page.component.ts
index 6f19a9b46..f7776f871 100644
--- a/apps/client/src/app/pages/pricing/pricing-page.component.ts
+++ b/apps/client/src/app/pages/pricing/pricing-page.component.ts
@@ -2,6 +2,7 @@ import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
import { DataService } from '@ghostfolio/client/services/data.service';
import { UserService } from '@ghostfolio/client/services/user/user.service';
import { User } from '@ghostfolio/common/interfaces';
+import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { translate } from '@ghostfolio/ui/i18n';
import { StripeService } from 'ngx-stripe';
import { Subject } from 'rxjs';
@@ -17,6 +18,7 @@ export class PricingPageComponent implements OnDestroy, OnInit {
public baseCurrency: string;
public coupon: number;
public couponId: string;
+ public hasPermissionToUpdateUserSettings: boolean;
public importAndExportTooltipBasic = translate(
'DATA_IMPORT_AND_EXPORT_TOOLTIP_BASIC'
);
@@ -55,6 +57,11 @@ export class PricingPageComponent implements OnDestroy, OnInit {
if (state?.user) {
this.user = state.user;
+ this.hasPermissionToUpdateUserSettings = hasPermission(
+ this.user.permissions,
+ permissions.updateUserSettings
+ );
+
this.coupon = subscriptions?.[this.user?.subscription?.offer]?.coupon;
this.couponId =
subscriptions?.[this.user.subscription.offer]?.couponId;
diff --git a/apps/client/src/app/pages/pricing/pricing-page.html b/apps/client/src/app/pages/pricing/pricing-page.html
index abd169a5e..1c1bb6c41 100644
--- a/apps/client/src/app/pages/pricing/pricing-page.html
+++ b/apps/client/src/app/pages/pricing/pricing-page.html
@@ -333,7 +333,7 @@
>