2024-08-26 13:47:08 +02:00
|
|
|
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
|
2024-08-27 17:54:59 +02:00
|
|
|
import { PermissionString } from "../type/permissionTypes";
|
|
|
|
import { role } from "./role";
|
2024-08-26 13:47:08 +02:00
|
|
|
|
|
|
|
@Entity()
|
2024-08-27 17:54:59 +02:00
|
|
|
export class rolePermission {
|
2024-08-26 13:47:08 +02:00
|
|
|
@PrimaryColumn({ type: "int" })
|
2024-08-27 17:54:59 +02:00
|
|
|
roleId: number;
|
2024-08-26 13:47:08 +02:00
|
|
|
|
|
|
|
@PrimaryColumn({ type: "varchar", length: 255 })
|
|
|
|
permission: PermissionString;
|
|
|
|
|
2024-09-14 11:33:13 +02:00
|
|
|
@ManyToOne(() => role, {
|
|
|
|
nullable: false,
|
|
|
|
onDelete: "CASCADE",
|
|
|
|
onUpdate: "RESTRICT",
|
|
|
|
})
|
2024-08-27 17:54:59 +02:00
|
|
|
role: role;
|
2024-08-26 13:47:08 +02:00
|
|
|
}
|