mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 22:54:42 -04: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
|
//TODO: Calculate patch
|
||||||
revisions.push(Revision.create(noteContent, noteContent));
|
revisions.push(Revision.create(noteContent, noteContent));
|
||||||
note.revisions = Promise.resolve(revisions);
|
note.revisions = Promise.resolve(revisions);
|
||||||
|
note.userPermissions = [];
|
||||||
|
note.groupPermissions = [];
|
||||||
return await this.noteRepository.save(note);
|
return await this.noteRepository.save(note);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,6 +272,7 @@ export class NotesService {
|
||||||
user,
|
user,
|
||||||
newUserPermission.canEdit,
|
newUserPermission.canEdit,
|
||||||
);
|
);
|
||||||
|
createdPermission.note = note;
|
||||||
note.userPermissions.push(createdPermission);
|
note.userPermissions.push(createdPermission);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,6 +285,7 @@ export class NotesService {
|
||||||
group,
|
group,
|
||||||
newGroupPermission.canEdit,
|
newGroupPermission.canEdit,
|
||||||
);
|
);
|
||||||
|
createdPermission.note = note;
|
||||||
note.groupPermissions.push(createdPermission);
|
note.groupPermissions.push(createdPermission);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue