src/app/models/permission.ts
Properties |
Accessors |
constructor(cfg?: IPermission)
|
||||||
Defined in src/app/models/permission.ts:12
|
||||||
Parameters :
|
details |
Type : string
|
Defined in src/app/models/permission.ts:12
|
provider |
Type : string
|
Defined in src/app/models/permission.ts:11
|
type |
Type : PermissionType
|
Defined in src/app/models/permission.ts:10
|
canCredit |
getcanCredit()
|
Defined in src/app/models/permission.ts:23
|
canDebit |
getcanDebit()
|
Defined in src/app/models/permission.ts:27
|
import { PermissionType } from '../enums/permission-type';
export interface IPermission {
type: PermissionType;
provider: string;
details: string;
}
export class Permission {
type: PermissionType;
provider: string;
details: string;
constructor(cfg?: IPermission) {
if (!cfg) {
return;
}
this.type = cfg.type !== null && cfg.type !== undefined ? cfg.type : undefined;
this.provider = cfg.provider ? cfg.provider : undefined;
this.details = cfg.details ? cfg.details : undefined;
}
get canCredit(): boolean {
return this.type === PermissionType.Credit;
}
get canDebit(): boolean {
return this.type === PermissionType.Debit;
}
}