lynx-framework
Version:
lynx is a NodeJS framework for Web Development, based on decorators and the async/await support.
30 lines (22 loc) • 654 B
text/typescript
import { Entity, PrimaryGeneratedColumn, Column, ManyToMany } from 'typeorm';
import BaseEntity from './base.entity';
import User from './user.entity';
('roles')
export default class Role extends BaseEntity {
static readonly ADMIN = 'admin';
static readonly ADMIN_LEVEL = 1000;
static readonly STAFF = 'staff';
static readonly STAFF_LEVEL = 500;
()
id: number;
({ unique: true })
name: string;
()
readableName: string;
()
description: string;
()
level: number;
((_) => User, (user) => user.roles)
users: User[];
}