user and role controllers
This commit is contained in:
parent
6865507545
commit
ab01fc2f76
25 changed files with 769 additions and 26 deletions
|
@ -1,5 +1,6 @@
|
|||
import { Column, Entity, ManyToMany, PrimaryColumn } from "typeorm";
|
||||
import { Column, Entity, ManyToMany, OneToMany, PrimaryColumn } from "typeorm";
|
||||
import { user } from "./user";
|
||||
import { rolePermission } from "./role_permission";
|
||||
|
||||
@Entity()
|
||||
export class role {
|
||||
|
@ -11,4 +12,7 @@ export class role {
|
|||
|
||||
@ManyToMany(() => user, (user) => user.roles)
|
||||
users: user[];
|
||||
|
||||
@OneToMany(() => rolePermission, (rolePermission) => rolePermission.role)
|
||||
permissions: rolePermission[];
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { Column, Entity, JoinTable, ManyToMany, PrimaryColumn } from "typeorm";
|
||||
import { Column, Entity, JoinTable, ManyToMany, OneToMany, PrimaryColumn } from "typeorm";
|
||||
import { role } from "./role";
|
||||
import { userPermission } from "./user_permission";
|
||||
|
||||
@Entity()
|
||||
export class user {
|
||||
|
@ -26,4 +27,7 @@ export class user {
|
|||
name: "user_roles",
|
||||
})
|
||||
roles: role[];
|
||||
|
||||
@OneToMany(() => userPermission, (userPermission) => userPermission.user)
|
||||
permissions: userPermission[];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue