Browse Source
Task/refactor read platforms permission (#6095)
* Refactor read platforms permission
pull/5800/merge
Thomas Kaul
2 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
3 additions and
2 deletions
-
apps/api/src/app/platform/platform.controller.ts
-
libs/common/src/lib/permissions.ts
|
|
|
@ -25,7 +25,7 @@ export class PlatformController { |
|
|
|
public constructor(private readonly platformService: PlatformService) {} |
|
|
|
|
|
|
|
@Get() |
|
|
|
@HasPermission(permissions.readPlatforms) |
|
|
|
@HasPermission(permissions.readPlatformsWithAccountCount) |
|
|
|
@UseGuards(AuthGuard('jwt'), HasPermissionGuard) |
|
|
|
public async getPlatforms() { |
|
|
|
return this.platformService.getPlatformsWithAccountCount(); |
|
|
|
|
|
|
|
@ -45,6 +45,7 @@ export const permissions = { |
|
|
|
readMarketDataOfMarkets: 'readMarketDataOfMarkets', |
|
|
|
readMarketDataOfOwnAssetProfile: 'readMarketDataOfOwnAssetProfile', |
|
|
|
readPlatforms: 'readPlatforms', |
|
|
|
readPlatformsWithAccountCount: 'readPlatformsWithAccountCount', |
|
|
|
readTags: 'readTags', |
|
|
|
readWatchlist: 'readWatchlist', |
|
|
|
reportDataGlitch: 'reportDataGlitch', |
|
|
|
@ -92,7 +93,7 @@ export function getPermissions(aRole: Role): string[] { |
|
|
|
permissions.readAiPrompt, |
|
|
|
permissions.readMarketData, |
|
|
|
permissions.readMarketDataOfOwnAssetProfile, |
|
|
|
permissions.readPlatforms, |
|
|
|
permissions.readPlatformsWithAccountCount, |
|
|
|
permissions.readTags, |
|
|
|
permissions.readWatchlist, |
|
|
|
permissions.updateAccount, |
|
|
|
|