ff-admin-server/src/entity/management/webapi_permission.ts

20 lines
503 B
TypeScript
Raw Normal View History

2025-01-21 11:47:28 +01:00
import { Column, Entity, ManyToOne, OneToMany, PrimaryColumn } from "typeorm";
2025-01-21 11:03:48 +01:00
import { PermissionObject, PermissionString } from "../../type/permissionTypes";
2025-01-22 09:39:31 +01:00
import { webapi } from "./webapi";
2025-01-21 11:03:48 +01:00
@Entity()
2025-01-22 09:39:31 +01:00
export class webapiPermission {
2025-01-21 11:03:48 +01:00
@PrimaryColumn({ type: "int" })
2025-01-22 09:39:31 +01:00
webapiId: number;
2025-01-21 11:03:48 +01:00
@PrimaryColumn({ type: "varchar", length: 255 })
permission: PermissionString;
2025-01-22 09:39:31 +01:00
@ManyToOne(() => webapi, {
2025-01-21 11:03:48 +01:00
nullable: false,
onDelete: "CASCADE",
onUpdate: "RESTRICT",
})
2025-01-22 09:39:31 +01:00
webapi: webapi;
2025-01-21 11:03:48 +01:00
}