src/app/models/user.model.ts
constructor(cfg?: IUser)
|
||||||
Defined in src/app/models/user.model.ts:29
|
||||||
Parameters :
|
isInAtLeastOneRole | ||||||
isInAtLeastOneRole(roles: string[])
|
||||||
Defined in src/app/models/user.model.ts:79
|
||||||
Parameters :
Returns :
boolean
|
isInRole | ||||||
isInRole(role: string)
|
||||||
Defined in src/app/models/user.model.ts:65
|
||||||
Parameters :
Returns :
boolean
|
isInRoles | ||||||
isInRoles(roles: string[])
|
||||||
Defined in src/app/models/user.model.ts:70
|
||||||
Parameters :
Returns :
boolean
|
accounts |
accounts:
|
Type : BankAccount[]
|
Defined in src/app/models/user.model.ts:29
|
address |
address:
|
Type : Address
|
Defined in src/app/models/user.model.ts:28
|
currentTheme |
currentTheme:
|
Type : string
|
Defined in src/app/models/user.model.ts:5
|
customerId |
customerId:
|
Type : string
|
Defined in src/app/models/user.model.ts:6
|
defaultFlexPayView |
defaultFlexPayView:
|
Type : string
|
Defined in src/app/models/user.model.ts:7
|
domain |
domain:
|
Type : string
|
Defined in src/app/models/user.model.ts:8
|
emailAddress |
emailAddress:
|
Type : string
|
Defined in src/app/models/user.model.ts:9
|
financialInstitutionId |
financialInstitutionId:
|
Type : string
|
Defined in src/app/models/user.model.ts:10
|
firstName |
firstName:
|
Type : string
|
Defined in src/app/models/user.model.ts:11
|
foreignKey |
foreignKey:
|
Type : string
|
Defined in src/app/models/user.model.ts:12
|
gPinKey |
gPinKey:
|
Type : string
|
Defined in src/app/models/user.model.ts:13
|
hasAcceptedDisclaimer |
hasAcceptedDisclaimer:
|
Type : boolean
|
Defined in src/app/models/user.model.ts:14
|
hasGoogleAuth |
hasGoogleAuth:
|
Type : boolean
|
Defined in src/app/models/user.model.ts:15
|
id |
id:
|
Type : string
|
Defined in src/app/models/user.model.ts:16
|
isEnrolled |
isEnrolled:
|
Type : boolean
|
Defined in src/app/models/user.model.ts:17
|
isForcePasswordChange |
isForcePasswordChange:
|
Type : boolean
|
Defined in src/app/models/user.model.ts:18
|
isPasswordExpired |
isPasswordExpired:
|
Type : boolean
|
Defined in src/app/models/user.model.ts:19
|
isPictureTipsHidden |
isPictureTipsHidden:
|
Type : boolean
|
Defined in src/app/models/user.model.ts:20
|
lastName |
lastName:
|
Type : string
|
Defined in src/app/models/user.model.ts:21
|
links |
links:
|
Type : string[]
|
Defined in src/app/models/user.model.ts:22
|
password |
password:
|
Type : string
|
Defined in src/app/models/user.model.ts:23
|
phoneNumbers |
phoneNumbers:
|
Type : string[]
|
Defined in src/app/models/user.model.ts:24
|
pinEnabled |
pinEnabled:
|
Type : boolean
|
Defined in src/app/models/user.model.ts:25
|
roles |
roles:
|
Type : string[]
|
Defined in src/app/models/user.model.ts:26
|
userName |
userName:
|
Type : string
|
Defined in src/app/models/user.model.ts:27
|
import { Address, BankAccount } from './';
import { IUser } from './i-user.model';
export class User {
currentTheme: string;
customerId: string;
defaultFlexPayView: string;
domain: string;
emailAddress: string;
financialInstitutionId: string;
firstName: string;
foreignKey: string;
gPinKey: string;
hasAcceptedDisclaimer: boolean;
hasGoogleAuth: boolean;
id: string;
isEnrolled: boolean;
isForcePasswordChange: boolean;
isPasswordExpired: boolean;
isPictureTipsHidden: boolean;
lastName: string;
links: string[];
password: string;
phoneNumbers: string[];
pinEnabled: boolean;
roles: string[];
userName: string;
address: Address;
accounts: BankAccount[];
constructor(cfg?: IUser) {
if (!cfg) {
this.userName = 'anonymous_user';
this.roles = [];
return;
}
this.currentTheme = cfg.currentTheme;
this.customerId = cfg.customerId;
this.defaultFlexPayView = cfg.defaultFlexPayView;
this.domain = cfg.domain;
this.emailAddress = cfg.emailAddress;
this.financialInstitutionId = cfg.financialInstitutionId;
this.firstName = cfg.firstName;
this.foreignKey = cfg.foreignKey;
this.gPinKey = cfg.gPinKey;
this.hasAcceptedDisclaimer = cfg.hasAcceptedDisclaimer;
this.hasGoogleAuth = cfg.hasGoogleAuth;
this.id = cfg.id;
this.isEnrolled = cfg.isEnrolled;
this.isForcePasswordChange = cfg.isForcePasswordChange;
this.isPasswordExpired = cfg.isPasswordExpired;
this.isPictureTipsHidden = cfg.isPictureTipsHidden;
this.lastName = cfg.lastName;
this.links = cfg.links;
this.password = cfg.password;
this.phoneNumbers = cfg.phoneNumbers;
this.pinEnabled = cfg.pinEnabled;
this.roles = cfg.roles;
this.userName = cfg.userName;
this.address = cfg.address;
this.accounts = cfg.accounts;
}
isInRole(role: string): boolean {
let matched = this.roles.filter(r => r === role);
return matched.length > 0;
}
isInRoles(roles: string[]): boolean {
let matches = roles
.map(role => {
return this.isInRole(role);
})
.filter(b => b);
return matches.length === roles.length;
}
isInAtLeastOneRole(roles: string[]): boolean {
let matches = roles
.map(role => {
return this.isInRole(role);
})
.filter(b => b);
return matches.length > 0;
}
}