Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Bugfix/fix permissions of impersonation mode in overview and holdings tabs (#5239)

Thomas Kaul7c147dfb6819
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 45be365fc3..7251f99b89 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Upgraded `Nx` from version `21.1.2` to `21.2.4`
- Upgraded `storybook` from version `8.6.12` to `9.0.17`
+### Fixed
+
+- Fixed an issue with the permissions of the impersonation mode related to the onboarding on the overview tab of the home page
+- Fixed an issue with the permissions of the impersonation mode related to the manage activities button of the holdings tab on the home page
+
## 2.184.0 - 2025-07-22
### Added
diff --git a/apps/client/src/app/app.component.ts b/apps/client/src/app/app.component.ts
index 48a96511ee..e7d0960e2b 100644
--- a/apps/client/src/app/app.component.ts
+++ b/apps/client/src/app/app.component.ts
@@ -324,7 +324,7 @@ export class AppComponent implements OnDestroy, OnInit {
this.user?.permissions,
permissions.accessAdminControl
),
- hasPermissionToCreateOrder:
+ hasPermissionToCreateActivity:
!this.hasImpersonationId &&
hasPermission(this.user?.permissions, permissions.createOrder) &&
!this.user?.settings?.isRestrictedView,
diff --git a/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html b/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html
index f136f1574a..45d88fc788 100644
--- a/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html
+++ b/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html
@@ -105,7 +105,7 @@
[locale]="user?.settings?.locale"
[showActions]="
!data.hasImpersonationId &&
- data.hasPermissionToCreateOrder &&
+ data.hasPermissionToCreateActivity &&
user?.settings?.isExperimentalFeatures &&
!user?.settings?.isRestrictedView
"
diff --git a/apps/client/src/app/components/account-detail-dialog/interfaces/interfaces.ts b/apps/client/src/app/components/account-detail-dialog/interfaces/interfaces.ts
index 9ad6a5ba4f..01c84e9566 100644
--- a/apps/client/src/app/components/account-detail-dialog/interfaces/interfaces.ts
+++ b/apps/client/src/app/components/account-detail-dialog/interfaces/interfaces.ts
@@ -2,5 +2,5 @@ export interface AccountDetailDialogParams {
accountId: string;
deviceType: string;
hasImpersonationId: boolean;
- hasPermissionToCreateOrder: boolean;
+ hasPermissionToCreateActivity: boolean;
}
diff --git a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html
index 6cd2fa42f9..4427cfcbb7 100644
--- a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html
+++ b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html
@@ -350,7 +350,7 @@
[locale]="data.locale"
[showActions]="
!data.hasImpersonationId &&
- data.hasPermissionToCreateOrder &&
+ data.hasPermissionToCreateActivity &&
user?.settings?.isExperimentalFeatures &&
!user?.settings?.isRestrictedView
"
diff --git a/apps/client/src/app/components/holding-detail-dialog/interfaces/interfaces.ts b/apps/client/src/app/components/holding-detail-dialog/interfaces/interfaces.ts
index e7d9edefb6..aab8543840 100644
--- a/apps/client/src/app/components/holding-detail-dialog/interfaces/interfaces.ts
+++ b/apps/client/src/app/components/holding-detail-dialog/interfaces/interfaces.ts
@@ -9,7 +9,7 @@ export interface HoldingDetailDialogParams {
deviceType: string;
hasImpersonationId: boolean;
hasPermissionToAccessAdminControl: boolean;
- hasPermissionToCreateOrder: boolean;
+ hasPermissionToCreateActivity: boolean;
hasPermissionToReportDataGlitch: boolean;
hasPermissionToUpdateOrder: boolean;
locale: string;
diff --git a/apps/client/src/app/components/home-holdings/home-holdings.component.ts b/apps/client/src/app/components/home-holdings/home-holdings.component.ts
index 4388c0c727..e4a369d411 100644
--- a/apps/client/src/app/components/home-holdings/home-holdings.component.ts
+++ b/apps/client/src/app/components/home-holdings/home-holdings.component.ts
@@ -57,7 +57,7 @@ export class GfHomeHoldingsComponent implements OnDestroy, OnInit {
public deviceType: string;
public hasImpersonationId: boolean;
public hasPermissionToAccessHoldingsChart: boolean;
- public hasPermissionToCreateOrder: boolean;
+ public hasPermissionToCreateActivity: boolean;
public holdings: PortfolioPosition[];
public holdingType: HoldingType = 'ACTIVE';
public holdingTypeOptions: ToggleOption[] = [
@@ -105,7 +105,7 @@ export class GfHomeHoldingsComponent implements OnDestroy, OnInit {
permissions.accessHoldingsChart
);
- this.hasPermissionToCreateOrder = hasPermission(
+ this.hasPermissionToCreateActivity = hasPermission(
this.user.permissions,
permissions.createOrder
);
diff --git a/apps/client/src/app/components/home-holdings/home-holdings.html b/apps/client/src/app/components/home-holdings/home-holdings.html
index 6040ffe2a1..8f9276fa50 100644
--- a/apps/client/src/app/components/home-holdings/home-holdings.html
+++ b/apps/client/src/app/components/home-holdings/home-holdings.html
@@ -52,7 +52,11 @@
[locale]="user?.settings?.locale"
(holdingClicked)="onHoldingClicked($event)"
/>
- @if (hasPermissionToCreateOrder && holdings?.length > 0) {
+ @if (
+ !hasImpersonationId &&
+ hasPermissionToCreateActivity &&
+ holdings?.length > 0
+ ) {
<div class="text-center">
<a
class="mt-3"
diff --git a/apps/client/src/app/components/home-overview/home-overview.component.ts b/apps/client/src/app/components/home-overview/home-overview.component.ts
index abf7017a60..db3e59f59a 100644
--- a/apps/client/src/app/components/home-overview/home-overview.component.ts
+++ b/apps/client/src/app/components/home-overview/home-overview.component.ts
@@ -48,7 +48,7 @@ export class GfHomeOverviewComponent implements OnDestroy, OnInit {
public errors: AssetProfileIdentifier[];
public hasError: boolean;
public hasImpersonationId: boolean;
- public hasPermissionToCreateOrder: boolean;
+ public hasPermissionToCreateActivity: boolean;
public historicalDataItems: LineChartItem[];
public isAllTimeHigh: boolean;
public isAllTimeLow: boolean;
@@ -80,7 +80,7 @@ export class GfHomeOverviewComponent implements OnDestroy, OnInit {
if (state?.user) {
this.user = state.user;
- this.hasPermissionToCreateOrder = hasPermission(
+ this.hasPermissionToCreateActivity = hasPermission(
this.user.permissions,
permissions.createOrder
);
diff --git a/apps/client/src/app/components/home-overview/home-overview.html b/apps/client/src/app/components/home-overview/home-overview.html
index c65d52f3f4..b36302dedf 100644
--- a/apps/client/src/app/components/home-overview/home-overview.html
+++ b/apps/client/src/app/components/home-overview/home-overview.html
@@ -1,7 +1,11 @@
<div
class="align-items-center container d-flex flex-column h-100 justify-content-center overview p-0 position-relative"
>
- @if (hasPermissionToCreateOrder && user?.activitiesCount === 0) {
+ @if (
+ !hasImpersonationId &&
+ hasPermissionToCreateActivity &&
+ user?.activitiesCount === 0
+ ) {
<div class="justify-content-center row w-100">
<div class="col introduction">
<h4 i18n>Welcome to Ghostfolio</h4>
diff --git a/apps/client/src/app/pages/accounts/accounts-page.component.ts b/apps/client/src/app/pages/accounts/accounts-page.component.ts
index 74ac21ec11..ff17c861fd 100644
--- a/apps/client/src/app/pages/accounts/accounts-page.component.ts
+++ b/apps/client/src/app/pages/accounts/accounts-page.component.ts
@@ -239,7 +239,7 @@ export class GfAccountsPageComponent implements OnDestroy, OnInit {
accountId: aAccountId,
deviceType: this.deviceType,
hasImpersonationId: this.hasImpersonationId,
- hasPermissionToCreateOrder:
+ hasPermissionToCreateActivity:
!this.hasImpersonationId &&
hasPermission(this.user?.permissions, permissions.createOrder) &&
!this.user?.settings?.isRestrictedView
diff --git a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
index 37eeae61f4..1b78745428 100644
--- a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
+++ b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
@@ -564,7 +564,7 @@ export class GfAllocationsPageComponent implements OnDestroy, OnInit {
accountId: aAccountId,
deviceType: this.deviceType,
hasImpersonationId: this.hasImpersonationId,
- hasPermissionToCreateOrder:
+ hasPermissionToCreateActivity:
!this.hasImpersonationId &&
hasPermission(this.user?.permissions, permissions.createOrder) &&
!this.user?.settings?.isRestrictedView