Browse Source

Feature/restrict permissions of demo user (#4697)

* Restrict permissions of demo user

* Update changelog
pull/4707/head^2
Thomas Kaul 2 months ago
committed by GitHub
parent
commit
698d71fb3a
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 8
      apps/api/src/app/user/user.service.ts

1
CHANGELOG.md

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Harmonized the data providers management style of the admin control panel
- Restricted the permissions of the demo user
- Renamed `Order` to `activities` in the `User` database schema
- Improved the language localization for Catalan (`ca`)
- Improved the language localization for Chinese (`zh`)

8
apps/api/src/app/user/user.service.ts

@ -394,9 +394,11 @@ export class UserService {
// Reset holdings view mode
user.Settings.settings.holdingsViewMode = undefined;
} else if (user.subscription?.type === 'Premium') {
currentPermissions.push(permissions.createApiKey);
currentPermissions.push(permissions.enableDataProviderGhostfolio);
currentPermissions.push(permissions.reportDataGlitch);
if (!hasRole(user, Role.DEMO)) {
currentPermissions.push(permissions.createApiKey);
currentPermissions.push(permissions.enableDataProviderGhostfolio);
currentPermissions.push(permissions.reportDataGlitch);
}
currentPermissions = without(
currentPermissions,

Loading…
Cancel
Save