28 lines
509 B
TypeScript
28 lines
509 B
TypeScript
import { Serializable } from '../Serializable';
|
|
|
|
export class Principal implements Serializable<Principal> {
|
|
|
|
id: number;
|
|
token: string;
|
|
name: string;
|
|
expiresAt: Date;
|
|
appRoles: Principal.AppRole[];
|
|
|
|
fromJSONObject(item: any): Principal {
|
|
this.id = item.id;
|
|
this.token = item.token;
|
|
this.name = item.name;
|
|
this.expiresAt = item.expiresAt;
|
|
this.appRoles = item.authorities;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
export namespace Principal {
|
|
export enum AppRole {
|
|
Admin = 2,
|
|
Manager = 1,
|
|
User = 0,
|
|
}
|
|
}
|