Browse Source

Refactoring

pull/1512/head
Thomas 3 years ago
parent
commit
a16f184334
  1. 4
      apps/api/src/app/auth/auth.module.ts
  2. 29
      apps/api/src/app/auth/auth.service.ts
  3. 17
      apps/api/src/app/info/info.service.ts
  4. 21
      apps/api/src/app/user/user.controller.ts
  5. 7
      apps/api/src/app/user/user.service.ts
  6. 1
      apps/api/src/services/configuration.service.ts
  7. 1
      apps/api/src/services/interfaces/environment.interface.ts
  8. 19
      apps/client/src/app/components/admin-overview/admin-overview.component.ts
  9. 17
      apps/client/src/app/components/admin-overview/admin-overview.html
  10. 5
      apps/client/src/app/components/header/header.component.html
  11. 8
      apps/client/src/app/components/header/header.component.ts
  12. 12
      apps/client/src/app/pages/landing/landing-page.component.ts
  13. 23
      apps/client/src/app/pages/landing/landing-page.html
  14. 7
      apps/client/src/app/pages/register/register-page.component.ts
  15. 4
      apps/client/src/app/pages/register/register-page.html
  16. 2
      libs/common/src/lib/config.ts
  17. 3
      libs/common/src/lib/permissions.ts

4
apps/api/src/app/auth/auth.module.ts

@ -3,7 +3,6 @@ import { WebAuthService } from '@ghostfolio/api/app/auth/web-auth.service';
import { SubscriptionModule } from '@ghostfolio/api/app/subscription/subscription.module'; import { SubscriptionModule } from '@ghostfolio/api/app/subscription/subscription.module';
import { UserModule } from '@ghostfolio/api/app/user/user.module'; import { UserModule } from '@ghostfolio/api/app/user/user.module';
import { ConfigurationModule } from '@ghostfolio/api/services/configuration.module'; import { ConfigurationModule } from '@ghostfolio/api/services/configuration.module';
import { PropertyModule } from '@ghostfolio/api/services/property/property.module';
import { PrismaModule } from '@ghostfolio/api/services/prisma.module'; import { PrismaModule } from '@ghostfolio/api/services/prisma.module';
import { Module } from '@nestjs/common'; import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt'; import { JwtModule } from '@nestjs/jwt';
@ -23,8 +22,7 @@ import { JwtStrategy } from './jwt.strategy';
}), }),
PrismaModule, PrismaModule,
SubscriptionModule, SubscriptionModule,
UserModule, UserModule
PropertyModule
], ],
providers: [ providers: [
AuthDeviceService, AuthDeviceService,

29
apps/api/src/app/auth/auth.service.ts

@ -1,18 +1,15 @@
import { UserService } from '@ghostfolio/api/app/user/user.service'; import { UserService } from '@ghostfolio/api/app/user/user.service';
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; import { ConfigurationService } from '@ghostfolio/api/services/configuration.service';
import { PropertyService } from '@ghostfolio/api/services/property/property.service';
import { Injectable, InternalServerErrorException } from '@nestjs/common'; import { Injectable, InternalServerErrorException } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt'; import { JwtService } from '@nestjs/jwt';
import { Provider } from '@prisma/client'; import { Provider } from '@prisma/client';
import { ValidateOAuthLoginParams } from './interfaces/interfaces'; import { ValidateOAuthLoginParams } from './interfaces/interfaces';
import { PROPERTY_DISABLE_USER_SIGNUP } from '@ghostfolio/common/config';
@Injectable() @Injectable()
export class AuthService { export class AuthService {
public constructor( public constructor(
private readonly configurationService: ConfigurationService, private readonly configurationService: ConfigurationService,
private readonly propertyService: PropertyService,
private readonly jwtService: JwtService, private readonly jwtService: JwtService,
private readonly userService: UserService private readonly userService: UserService
) {} ) {}
@ -53,19 +50,6 @@ export class AuthService {
}); });
if (!user) { if (!user) {
// Guard new user registration based on config property
if (this.configurationService.get('ENABLE_FEATURE_USER_SIGNUP_CONTROL')) {
const isUserSignupDisabled = (await this.propertyService.getByKey(
PROPERTY_DISABLE_USER_SIGNUP
)) as boolean;
if(isUserSignupDisabled){
throw new InternalServerErrorException(
'validateInternetIdentityLogin',
'Not Allowed'
);
}
}
// Create new user if not found // Create new user if not found
user = await this.userService.createUser({ user = await this.userService.createUser({
provider, provider,
@ -94,19 +78,6 @@ export class AuthService {
}); });
if (!user) { if (!user) {
// Guard new user registration based on config property
if (this.configurationService.get('ENABLE_FEATURE_USER_SIGNUP_CONTROL')) {
const isUserSignupDisabled = (await this.propertyService.getByKey(
PROPERTY_DISABLE_USER_SIGNUP
)) as boolean;
if(isUserSignupDisabled){
throw new InternalServerErrorException(
'validateInternetIdentityLogin',
'Not Allowed'
);
}
}
// Create new user if not found // Create new user if not found
user = await this.userService.createUser({ user = await this.userService.createUser({
provider, provider,

17
apps/api/src/app/info/info.service.ts

@ -8,10 +8,10 @@ import { TagService } from '@ghostfolio/api/services/tag/tag.service';
import { import {
DEMO_USER_ID, DEMO_USER_ID,
PROPERTY_IS_READ_ONLY_MODE, PROPERTY_IS_READ_ONLY_MODE,
PROPERTY_IS_USER_SIGNUP_ENABLED,
PROPERTY_SLACK_COMMUNITY_USERS, PROPERTY_SLACK_COMMUNITY_USERS,
PROPERTY_STRIPE_CONFIG, PROPERTY_STRIPE_CONFIG,
PROPERTY_SYSTEM_MESSAGE, PROPERTY_SYSTEM_MESSAGE,
PROPERTY_DISABLE_USER_SIGNUP,
ghostfolioFearAndGreedIndexDataSource ghostfolioFearAndGreedIndexDataSource
} from '@ghostfolio/common/config'; } from '@ghostfolio/common/config';
import { import {
@ -104,16 +104,13 @@ export class InfoService {
)) as string; )) as string;
} }
if (this.configurationService.get('ENABLE_FEATURE_USER_SIGNUP_CONTROL')) { const isUserSignupEnabled =
const isUserSignupDisabled = (await this.propertyService.getByKey( ((await this.propertyService.getByKey(
PROPERTY_DISABLE_USER_SIGNUP PROPERTY_IS_USER_SIGNUP_ENABLED
)) as boolean; )) as boolean) ?? true;
if (!isUserSignupDisabled) { if (isUserSignupEnabled) {
globalPermissions.push(permissions.createUserAccount); globalPermissions.push(permissions.createUserAccount);
}
} else { // By default enabled
globalPermissions.push(permissions.createUserAccount);
} }
return { return {

21
apps/api/src/app/user/user.controller.ts

@ -2,7 +2,7 @@ import { ConfigurationService } from '@ghostfolio/api/services/configuration.ser
import { PropertyService } from '@ghostfolio/api/services/property/property.service'; import { PropertyService } from '@ghostfolio/api/services/property/property.service';
import { import {
PROPERTY_IS_READ_ONLY_MODE, PROPERTY_IS_READ_ONLY_MODE,
PROPERTY_DISABLE_USER_SIGNUP PROPERTY_IS_USER_SIGNUP_ENABLED
} from '@ghostfolio/common/config'; } from '@ghostfolio/common/config';
import { User, UserSettings } from '@ghostfolio/common/interfaces'; import { User, UserSettings } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { hasPermission, permissions } from '@ghostfolio/common/permissions';
@ -85,17 +85,16 @@ export class UserController {
} }
} }
if (this.configurationService.get('ENABLE_FEATURE_USER_SIGNUP_CONTROL')) { const isUserSignupEnabled =
const isUserSignupDisabled = (await this.propertyService.getByKey( ((await this.propertyService.getByKey(
PROPERTY_DISABLE_USER_SIGNUP PROPERTY_IS_USER_SIGNUP_ENABLED
)) as boolean; )) as boolean) ?? true;
if (isUserSignupDisabled) { if (!isUserSignupEnabled) {
throw new HttpException( throw new HttpException(
getReasonPhrase(StatusCodes.FORBIDDEN), getReasonPhrase(StatusCodes.FORBIDDEN),
StatusCodes.FORBIDDEN StatusCodes.FORBIDDEN
); );
}
} }
const hasAdmin = await this.userService.hasAdmin(); const hasAdmin = await this.userService.hasAdmin();

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

@ -165,12 +165,6 @@ export class UserService {
currentPermissions.push(permissions.reportDataGlitch); currentPermissions.push(permissions.reportDataGlitch);
} }
if (this.configurationService.get('ENABLE_FEATURE_USER_SIGNUP_CONTROL')) {
if (hasRole(user, Role.ADMIN)) {
currentPermissions.push(permissions.toggleUserSignupMode);
}
}
if (this.configurationService.get('ENABLE_FEATURE_READ_ONLY_MODE')) { if (this.configurationService.get('ENABLE_FEATURE_READ_ONLY_MODE')) {
if (hasRole(user, Role.ADMIN)) { if (hasRole(user, Role.ADMIN)) {
currentPermissions.push(permissions.toggleReadOnlyMode); currentPermissions.push(permissions.toggleReadOnlyMode);
@ -224,7 +218,6 @@ export class UserService {
} }
public async createUser(data: Prisma.UserCreateInput): Promise<User> { public async createUser(data: Prisma.UserCreateInput): Promise<User> {
if (!data?.provider) { if (!data?.provider) {
data.provider = 'ANONYMOUS'; data.provider = 'ANONYMOUS';
} }

1
apps/api/src/services/configuration.service.ts

@ -30,7 +30,6 @@ export class ConfigurationService {
ENABLE_FEATURE_STATISTICS: bool({ default: false }), ENABLE_FEATURE_STATISTICS: bool({ default: false }),
ENABLE_FEATURE_SUBSCRIPTION: bool({ default: false }), ENABLE_FEATURE_SUBSCRIPTION: bool({ default: false }),
ENABLE_FEATURE_SYSTEM_MESSAGE: bool({ default: false }), ENABLE_FEATURE_SYSTEM_MESSAGE: bool({ default: false }),
ENABLE_FEATURE_USER_SIGNUP_CONTROL: bool({ default: false }),
EOD_HISTORICAL_DATA_API_KEY: str({ default: '' }), EOD_HISTORICAL_DATA_API_KEY: str({ default: '' }),
GOOGLE_CLIENT_ID: str({ default: 'dummyClientId' }), GOOGLE_CLIENT_ID: str({ default: 'dummyClientId' }),
GOOGLE_SECRET: str({ default: 'dummySecret' }), GOOGLE_SECRET: str({ default: 'dummySecret' }),

1
apps/api/src/services/interfaces/environment.interface.ts

@ -16,7 +16,6 @@ export interface Environment extends CleanedEnvAccessors {
ENABLE_FEATURE_STATISTICS: boolean; ENABLE_FEATURE_STATISTICS: boolean;
ENABLE_FEATURE_SUBSCRIPTION: boolean; ENABLE_FEATURE_SUBSCRIPTION: boolean;
ENABLE_FEATURE_SYSTEM_MESSAGE: boolean; ENABLE_FEATURE_SYSTEM_MESSAGE: boolean;
ENABLE_FEATURE_USER_SIGNUP_CONTROL: boolean;
EOD_HISTORICAL_DATA_API_KEY: string; EOD_HISTORICAL_DATA_API_KEY: string;
GOOGLE_CLIENT_ID: string; GOOGLE_CLIENT_ID: string;
GOOGLE_SECRET: string; GOOGLE_SECRET: string;

19
apps/client/src/app/components/admin-overview/admin-overview.component.ts

@ -7,8 +7,8 @@ import {
PROPERTY_COUPONS, PROPERTY_COUPONS,
PROPERTY_CURRENCIES, PROPERTY_CURRENCIES,
PROPERTY_IS_READ_ONLY_MODE, PROPERTY_IS_READ_ONLY_MODE,
PROPERTY_SYSTEM_MESSAGE, PROPERTY_IS_USER_SIGNUP_ENABLED,
PROPERTY_DISABLE_USER_SIGNUP PROPERTY_SYSTEM_MESSAGE
} from '@ghostfolio/common/config'; } from '@ghostfolio/common/config';
import { Coupon, InfoItem, User } from '@ghostfolio/common/interfaces'; import { Coupon, InfoItem, User } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { hasPermission, permissions } from '@ghostfolio/common/permissions';
@ -35,8 +35,8 @@ export class AdminOverviewComponent implements OnDestroy, OnInit {
public hasPermissionForSubscription: boolean; public hasPermissionForSubscription: boolean;
public hasPermissionForSystemMessage: boolean; public hasPermissionForSystemMessage: boolean;
public hasPermissionToToggleReadOnlyMode: boolean; public hasPermissionToToggleReadOnlyMode: boolean;
public hasPermissionToToggleUserSignupMode: boolean;
public info: InfoItem; public info: InfoItem;
public permissions = permissions;
public transactionCount: number; public transactionCount: number;
public userCount: number; public userCount: number;
public user: User; public user: User;
@ -71,11 +71,6 @@ export class AdminOverviewComponent implements OnDestroy, OnInit {
this.user.permissions, this.user.permissions,
permissions.toggleReadOnlyMode permissions.toggleReadOnlyMode
); );
this.hasPermissionToToggleUserSignupMode = hasPermission(
this.user.permissions,
permissions.toggleUserSignupMode
);
} }
}); });
} }
@ -175,9 +170,11 @@ export class AdminOverviewComponent implements OnDestroy, OnInit {
} }
public onEnableUserSignupModeChange(aEvent: MatSlideToggleChange) { public onEnableUserSignupModeChange(aEvent: MatSlideToggleChange) {
console.log(aEvent);
this.putAdminSetting({ this.putAdminSetting({
key: PROPERTY_DISABLE_USER_SIGNUP, key: PROPERTY_IS_USER_SIGNUP_ENABLED,
value: aEvent.checked ? true : undefined value: aEvent.checked ? undefined : false
}); });
} }
@ -228,7 +225,7 @@ export class AdminOverviewComponent implements OnDestroy, OnInit {
private putAdminSetting({ key, value }: { key: string; value: any }) { private putAdminSetting({ key, value }: { key: string; value: any }) {
this.dataService this.dataService
.putAdminSetting(key, { .putAdminSetting(key, {
value: value ? JSON.stringify(value) : undefined value: value || value === false ? JSON.stringify(value) : undefined
}) })
.pipe(takeUntil(this.unsubscribeSubject)) .pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => { .subscribe(() => {

17
apps/client/src/app/components/admin-overview/admin-overview.html

@ -109,24 +109,23 @@
</button> </button>
</div> </div>
</div> </div>
<div *ngIf="hasPermissionToToggleReadOnlyMode" class="d-flex my-3"> <div class="d-flex my-3">
<div class="w-50" i18n>Read-only Mode</div> <div class="w-50" i18n>Enable User Signup</div>
<div class="w-50"> <div class="w-50">
<mat-slide-toggle <mat-slide-toggle
color="primary" color="primary"
[checked]="info?.isReadOnlyMode" [checked]="info.globalPermissions.includes(permissions.createUserAccount)"
(change)="onReadOnlyModeChange($event)" (change)="onEnableUserSignupModeChange($event)"
></mat-slide-toggle> ></mat-slide-toggle>
</div> </div>
</div> </div>
<div class="d-flex my-3"> <div *ngIf="hasPermissionToToggleReadOnlyMode" class="d-flex my-3">
<div class="w-50" i18n> Disable User Signup </div> <div class="w-50" i18n>Read-only Mode</div>
<div class="w-50"> <div class="w-50">
<mat-slide-toggle <mat-slide-toggle
color="primary" color="primary"
[disabled]="!hasPermissionToToggleUserSignupMode" [checked]="info?.isReadOnlyMode"
[checked]="!info.globalPermissions.includes('createUserAccount')" (change)="onReadOnlyModeChange($event)"
(change)="onEnableUserSignupModeChange($event)"
></mat-slide-toggle> ></mat-slide-toggle>
</div> </div>
</div> </div>

5
apps/client/src/app/components/header/header.component.html

@ -1,9 +1,9 @@
<mat-toolbar class="px-2"> <mat-toolbar class="px-2">
<ng-container *ngIf="user"> <ng-container *ngIf="user">
<a <a
[routerLink]="['/']"
class="align-items-center d-flex h-100 no-min-width px-2 rounded-0" class="align-items-center d-flex h-100 no-min-width px-2 rounded-0"
mat-button mat-button
[routerLink]="['/']"
> >
<gf-logo></gf-logo> <gf-logo></gf-logo>
</a> </a>
@ -289,8 +289,7 @@
<ng-container i18n>Sign in</ng-container> <ng-container i18n>Sign in</ng-container>
</button> </button>
<a <a
*ngIf="currentRoute !== 'register' && !info?.isReadOnlyMode && *ngIf="currentRoute !== 'register' && hasPermissionToCreateUser"
info.globalPermissions.includes('createUserAccount')"
class="d-none d-sm-block" class="d-none d-sm-block"
color="primary" color="primary"
mat-flat-button mat-flat-button

8
apps/client/src/app/components/header/header.component.ts

@ -38,6 +38,7 @@ export class HeaderComponent implements OnChanges {
public hasPermissionForSubscription: boolean; public hasPermissionForSubscription: boolean;
public hasPermissionToAccessAdminControl: boolean; public hasPermissionToAccessAdminControl: boolean;
public hasPermissionToAccessFearAndGreedIndex: boolean; public hasPermissionToAccessFearAndGreedIndex: boolean;
public hasPermissionToCreateUser: boolean;
public impersonationId: string; public impersonationId: string;
public isMenuOpen: boolean; public isMenuOpen: boolean;
@ -79,6 +80,13 @@ export class HeaderComponent implements OnChanges {
this.info?.globalPermissions, this.info?.globalPermissions,
permissions.enableFearAndGreedIndex permissions.enableFearAndGreedIndex
); );
this.hasPermissionToCreateUser =
!this.info?.isReadOnlyMode &&
hasPermission(
this.info?.globalPermissions,
permissions.createUserAccount
);
} }
public impersonateAccount(aId: string) { public impersonateAccount(aId: string) {

12
apps/client/src/app/pages/landing/landing-page.component.ts

@ -17,7 +17,7 @@ export class LandingPageComponent implements OnDestroy, OnInit {
public demoAuthToken: string; public demoAuthToken: string;
public deviceType: string; public deviceType: string;
public hasPermissionForStatistics: boolean; public hasPermissionForStatistics: boolean;
public hasPermissionForUserSignup: boolean; public hasPermissionToCreateUser: boolean;
public statistics: Statistics; public statistics: Statistics;
public testimonials = [ public testimonials = [
{ {
@ -48,17 +48,17 @@ export class LandingPageComponent implements OnDestroy, OnInit {
private dataService: DataService, private dataService: DataService,
private deviceService: DeviceDetectorService private deviceService: DeviceDetectorService
) { ) {
const { globalPermissions, statistics } = this.dataService.fetchInfo(); const { globalPermissions, isReadOnlyMode, statistics } =
this.dataService.fetchInfo();
this.hasPermissionForStatistics = hasPermission( this.hasPermissionForStatistics = hasPermission(
globalPermissions, globalPermissions,
permissions.enableStatistics permissions.enableStatistics
); );
this.hasPermissionForUserSignup = hasPermission( this.hasPermissionToCreateUser =
globalPermissions, !isReadOnlyMode &&
permissions.createUserAccount hasPermission(globalPermissions, permissions.createUserAccount);
);
this.statistics = statistics; this.statistics = statistics;
} }

23
apps/client/src/app/pages/landing/landing-page.html

@ -28,18 +28,21 @@
</div> </div>
<div class="container"> <div class="container">
<div class="button-container mb-5 row" *ngIf="hasPermissionForUserSignup"> <div class="button-container mb-5 row">
<div class="align-items-center col d-flex justify-content-center"> <div class="align-items-center col d-flex justify-content-center">
<div class="text-center"> <div class="text-center">
<a <ng-container *ngIf="hasPermissionToCreateUser">
class="d-inline-block" <a
color="primary" class="d-inline-block"
mat-flat-button color="primary"
[routerLink]="['/register']" mat-flat-button
[routerLink]="['/register']"
>
Get Started
</a>
<div class="d-inline-block mx-3 text-muted">or</div></ng-container
> >
Get Started
</a>
<div class="d-inline-block mx-3 text-muted">or</div>
<a class="d-inline-block" mat-stroked-button [routerLink]="['/demo']"> <a class="d-inline-block" mat-stroked-button [routerLink]="['/demo']">
Live Demo Live Demo
</a> </a>
@ -306,7 +309,7 @@
</div> </div>
</div> </div>
<div class="row my-5" *ngIf="hasPermissionForUserSignup"> <div *ngIf="hasPermissionToCreateUser" class="row my-5">
<div class="col"> <div class="col">
<h2 class="h4 mb-1 text-center">Are <strong>you</strong> ready?</h2> <h2 class="h4 mb-1 text-center">Are <strong>you</strong> ready?</h2>
<p class="lead mb-3 text-center"> <p class="lead mb-3 text-center">

7
apps/client/src/app/pages/register/register-page.component.ts

@ -25,6 +25,7 @@ export class RegisterPageComponent implements OnDestroy, OnInit {
public demoAuthToken: string; public demoAuthToken: string;
public deviceType: string; public deviceType: string;
public hasPermissionForSocialLogin: boolean; public hasPermissionForSocialLogin: boolean;
public hasPermissionToCreateUser: boolean;
public historicalDataItems: LineChartItem[]; public historicalDataItems: LineChartItem[];
public info: InfoItem; public info: InfoItem;
@ -44,7 +45,8 @@ export class RegisterPageComponent implements OnDestroy, OnInit {
} }
public ngOnInit() { public ngOnInit() {
const { demoAuthToken, globalPermissions } = this.dataService.fetchInfo(); const { demoAuthToken, globalPermissions, isReadOnlyMode } =
this.dataService.fetchInfo();
this.demoAuthToken = demoAuthToken; this.demoAuthToken = demoAuthToken;
this.deviceType = this.deviceService.getDeviceInfo().deviceType; this.deviceType = this.deviceService.getDeviceInfo().deviceType;
@ -52,6 +54,9 @@ export class RegisterPageComponent implements OnDestroy, OnInit {
globalPermissions, globalPermissions,
permissions.enableSocialLogin permissions.enableSocialLogin
); );
this.hasPermissionToCreateUser =
!isReadOnlyMode &&
hasPermission(globalPermissions, permissions.createUserAccount);
} }
public async createAccount() { public async createAccount() {

4
apps/client/src/app/pages/register/register-page.html

@ -14,14 +14,14 @@
</div> </div>
</div> </div>
<div class="button-container row"> <div *ngIf="hasPermissionToCreateUser" class="button-container row">
<div class="align-items-center col d-flex justify-content-center"> <div class="align-items-center col d-flex justify-content-center">
<div class="py-5 text-center"> <div class="py-5 text-center">
<button <button
class="d-inline-block" class="d-inline-block"
color="primary" color="primary"
mat-flat-button mat-flat-button
[disabled]="!demoAuthToken || info?.isReadOnlyMode" [disabled]="!demoAuthToken"
(click)="createAccount()" (click)="createAccount()"
> >
<ng-container i18n>Create Account</ng-container> <ng-container i18n>Create Account</ng-container>

2
libs/common/src/lib/config.ts

@ -74,10 +74,10 @@ export const PROPERTY_BENCHMARKS = 'BENCHMARKS';
export const PROPERTY_COUPONS = 'COUPONS'; export const PROPERTY_COUPONS = 'COUPONS';
export const PROPERTY_CURRENCIES = 'CURRENCIES'; export const PROPERTY_CURRENCIES = 'CURRENCIES';
export const PROPERTY_IS_READ_ONLY_MODE = 'IS_READ_ONLY_MODE'; export const PROPERTY_IS_READ_ONLY_MODE = 'IS_READ_ONLY_MODE';
export const PROPERTY_IS_USER_SIGNUP_ENABLED = 'IS_USER_SIGNUP_ENABLED';
export const PROPERTY_SLACK_COMMUNITY_USERS = 'SLACK_COMMUNITY_USERS'; export const PROPERTY_SLACK_COMMUNITY_USERS = 'SLACK_COMMUNITY_USERS';
export const PROPERTY_STRIPE_CONFIG = 'STRIPE_CONFIG'; export const PROPERTY_STRIPE_CONFIG = 'STRIPE_CONFIG';
export const PROPERTY_SYSTEM_MESSAGE = 'SYSTEM_MESSAGE'; export const PROPERTY_SYSTEM_MESSAGE = 'SYSTEM_MESSAGE';
export const PROPERTY_DISABLE_USER_SIGNUP = 'PROPERTY_DISABLE_USER_SIGNUP';
export const QUEUE_JOB_STATUS_LIST = <JobStatus[]>[ export const QUEUE_JOB_STATUS_LIST = <JobStatus[]>[
'active', 'active',

3
libs/common/src/lib/permissions.ts

@ -26,8 +26,7 @@ export const permissions = {
updateAuthDevice: 'updateAuthDevice', updateAuthDevice: 'updateAuthDevice',
updateOrder: 'updateOrder', updateOrder: 'updateOrder',
updateUserSettings: 'updateUserSettings', updateUserSettings: 'updateUserSettings',
updateViewMode: 'updateViewMode', updateViewMode: 'updateViewMode'
toggleUserSignupMode: 'toggleUserSignupMode'
}; };
export function getPermissions(aRole: Role): string[] { export function getPermissions(aRole: Role): string[] {

Loading…
Cancel
Save