Fixed user<-> Group relationship
This commit is contained in:
parent
d47983a032
commit
4a9fd57356
|
@ -1,4 +1,4 @@
|
|||
import { Entity, Column, OneToMany, ManyToOne, PrimaryGeneratedColumn, Generated, Unique } from "typeorm";
|
||||
import { Entity, Column, OneToMany, ManyToOne, PrimaryGeneratedColumn, Generated, Unique, JoinTable, ManyToMany } from "typeorm";
|
||||
import { IsBoolean, IsEmail, IsInt, IsNotEmpty, IsOptional, IsString, isUUID, } from "class-validator";
|
||||
import { UserGroup } from './UserGroup';
|
||||
|
||||
|
@ -73,9 +73,8 @@ export class User {
|
|||
/**
|
||||
* groups
|
||||
*/
|
||||
// TODO: UserGroup implementation
|
||||
// @OneToMany(() => UserGroup, usergroup => usergroup.)
|
||||
@IsOptional()
|
||||
@ManyToMany(() => UserGroup)
|
||||
@JoinTable()
|
||||
groups: UserGroup[];
|
||||
|
||||
/**
|
||||
|
|
|
@ -37,7 +37,7 @@ export abstract class UserGroup {
|
|||
description: string;
|
||||
|
||||
/**
|
||||
* Used to link users to a user group.
|
||||
* TODO: Something about permission stuff
|
||||
*/
|
||||
// TODO:
|
||||
// grouppermissions: GroupPermissions[];
|
||||
|
|
Loading…
Reference in New Issue