mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-27 19:52:34 +00:00
NotesService: Set Permissions
Set the necessary information for the permissions to be correctly inserted into the db. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
979154b8a5
commit
305a3f1bea
1 changed files with 4 additions and 0 deletions
|
@ -224,6 +224,8 @@ export class NotesService {
|
|||
//TODO: Calculate patch
|
||||
revisions.push(Revision.create(noteContent, noteContent));
|
||||
note.revisions = Promise.resolve(revisions);
|
||||
note.userPermissions = [];
|
||||
note.groupPermissions = [];
|
||||
return await this.noteRepository.save(note);
|
||||
}
|
||||
|
||||
|
@ -270,6 +272,7 @@ export class NotesService {
|
|||
user,
|
||||
newUserPermission.canEdit,
|
||||
);
|
||||
createdPermission.note = note;
|
||||
note.userPermissions.push(createdPermission);
|
||||
}
|
||||
|
||||
|
@ -282,6 +285,7 @@ export class NotesService {
|
|||
group,
|
||||
newGroupPermission.canEdit,
|
||||
);
|
||||
createdPermission.note = note;
|
||||
note.groupPermissions.push(createdPermission);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue