mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-31 15:18:38 -04:00
Merge pull request #1039 from hedgedoc/fix/permissionsCreationAndFinding
This commit is contained in:
commit
eaa5254418
5 changed files with 54 additions and 5 deletions
|
@ -10,10 +10,16 @@ import { Note } from '../notes/note.entity';
|
|||
|
||||
@Entity()
|
||||
export class NoteGroupPermission {
|
||||
@ManyToOne((_) => Group, { primary: true })
|
||||
@ManyToOne((_) => Group, {
|
||||
primary: true,
|
||||
onDelete: 'CASCADE', // This deletes the NoteGroupPermission, when the associated Group is deleted
|
||||
})
|
||||
group: Group;
|
||||
|
||||
@ManyToOne((_) => Note, (note) => note.groupPermissions, { primary: true })
|
||||
@ManyToOne((_) => Note, (note) => note.groupPermissions, {
|
||||
primary: true,
|
||||
onDelete: 'CASCADE', // This deletes the NoteGroupPermission, when the associated Note is deleted
|
||||
})
|
||||
note: Note;
|
||||
|
||||
@Column()
|
||||
|
|
|
@ -10,10 +10,16 @@ import { User } from '../users/user.entity';
|
|||
|
||||
@Entity()
|
||||
export class NoteUserPermission {
|
||||
@ManyToOne((_) => User, { primary: true })
|
||||
@ManyToOne((_) => User, {
|
||||
primary: true,
|
||||
onDelete: 'CASCADE', // This deletes the NoteUserPermission, when the associated Note is deleted
|
||||
})
|
||||
user: User;
|
||||
|
||||
@ManyToOne((_) => Note, (note) => note.userPermissions, { primary: true })
|
||||
@ManyToOne((_) => Note, (note) => note.userPermissions, {
|
||||
primary: true,
|
||||
onDelete: 'CASCADE', // This deletes the NoteUserPermission, when the associated Note is deleted
|
||||
})
|
||||
note: Note;
|
||||
|
||||
@Column()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue