Browse Source

Restrict asset endpoint to authenticated users

pull/8270/head
Thomas Kaul 15 hours ago
parent
commit
a0bfda518f
  1. 3
      apps/client/src/app/components/markets/markets.component.ts
  2. 2
      apps/client/src/app/components/markets/markets.html

3
apps/client/src/app/components/markets/markets.component.ts

@ -66,6 +66,7 @@ export class GfMarketsComponent implements OnInit {
protected fearAndGreedIndex: number | undefined; protected fearAndGreedIndex: number | undefined;
protected fearAndGreedIndexMode: FearAndGreedIndexMode = 'STOCKS'; protected fearAndGreedIndexMode: FearAndGreedIndexMode = 'STOCKS';
protected hasPermissionToAccessFearAndGreedIndex: boolean; protected hasPermissionToAccessFearAndGreedIndex: boolean;
protected hasPermissionToOpenBenchmarkDetails = false;
protected hasPermissionToReadMarketDataOfMarkets: boolean; protected hasPermissionToReadMarketDataOfMarkets: boolean;
protected historicalDataItems: LineChartItem[]; protected historicalDataItems: LineChartItem[];
protected isLoadingFearAndGreedIndex = true; protected isLoadingFearAndGreedIndex = true;
@ -99,6 +100,8 @@ export class GfMarketsComponent implements OnInit {
if (state?.user) { if (state?.user) {
this.user = state.user; this.user = state.user;
this.hasPermissionToOpenBenchmarkDetails = true;
this.hasPermissionToReadMarketDataOfMarkets = hasPermission( this.hasPermissionToReadMarketDataOfMarkets = hasPermission(
this.user.permissions, this.user.permissions,
permissions.readMarketDataOfMarkets permissions.readMarketDataOfMarkets

2
apps/client/src/app/components/markets/markets.html

@ -52,7 +52,7 @@
<gf-benchmark <gf-benchmark
[benchmarks]="benchmarks()" [benchmarks]="benchmarks()"
[deviceType]="deviceType()" [deviceType]="deviceType()"
[hasPermissionToOpenDetails]="!!user" [hasPermissionToOpenDetails]="hasPermissionToOpenBenchmarkDetails"
[locale]="user?.settings?.locale ?? DEFAULT_LOCALE" [locale]="user?.settings?.locale ?? DEFAULT_LOCALE"
[showSymbol]="false" [showSymbol]="false"
[user]="user" [user]="user"

Loading…
Cancel
Save