mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 17:55:17 -04:00
Add relation between User and Group
This represents the users which are members of this group Signed-off-by: Yannick Bungers <git@innay.de>
This commit is contained in:
parent
910f634b5f
commit
f8e07f6940
12 changed files with 103 additions and 16 deletions
|
@ -7,6 +7,7 @@
|
|||
import {
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
ManyToMany,
|
||||
PrimaryGeneratedColumn,
|
||||
UpdateDateColumn,
|
||||
} from 'typeorm';
|
||||
|
@ -14,6 +15,7 @@ import { Column, OneToMany } from 'typeorm';
|
|||
import { Note } from '../notes/note.entity';
|
||||
import { AuthToken } from '../auth/auth-token.entity';
|
||||
import { Identity } from './identity.entity';
|
||||
import { Group } from '../groups/group.entity';
|
||||
import { HistoryEntry } from '../history/history-entry.entity';
|
||||
|
||||
@Entity()
|
||||
|
@ -52,9 +54,15 @@ export class User {
|
|||
@OneToMany((_) => Identity, (identity) => identity.user)
|
||||
identities: Identity[];
|
||||
|
||||
@ManyToMany((_) => Group, (group) => group.members)
|
||||
groups: Group[];
|
||||
|
||||
@OneToMany((_) => HistoryEntry, (historyEntry) => historyEntry.user)
|
||||
historyEntries: HistoryEntry[];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
private constructor() {}
|
||||
|
||||
public static create(
|
||||
userName: string,
|
||||
displayName: string,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue