mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 09:45:37 -04:00
Permissions: Add cascade
This makes it possible to create permissions by setting them in the note entity and delete them when either the user or note is deleted. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
f3d53a687b
commit
029dc0d7d6
3 changed files with 22 additions and 5 deletions
|
@ -39,9 +39,14 @@ export class Note {
|
|||
@OneToMany(
|
||||
(_) => NoteGroupPermission,
|
||||
(groupPermission) => groupPermission.note,
|
||||
{ cascade: true }, // This ensures that embedded NoteGroupPermissions are automatically saved to the database
|
||||
)
|
||||
groupPermissions: NoteGroupPermission[];
|
||||
@OneToMany((_) => NoteUserPermission, (userPermission) => userPermission.note)
|
||||
@OneToMany(
|
||||
(_) => NoteUserPermission,
|
||||
(userPermission) => userPermission.note,
|
||||
{ cascade: true }, // This ensures that embedded NoteUserPermission are automatically saved to the database
|
||||
)
|
||||
userPermissions: NoteUserPermission[];
|
||||
@Column({
|
||||
nullable: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue