refactor(edit): lazy-load relations

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-12-05 19:58:01 +01:00
parent 7f7886c5a7
commit 4e70044a2c
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
5 changed files with 26 additions and 20 deletions

View file

@ -55,11 +55,11 @@ export class PermissionsGuard implements CanActivate {
const note = await getNote(this.noteService, noteIdOrAlias);
switch (permissions[0]) {
case Permission.READ:
return this.permissionsService.mayRead(user, note);
return await this.permissionsService.mayRead(user, note);
case Permission.WRITE:
return this.permissionsService.mayWrite(user, note);
return await this.permissionsService.mayWrite(user, note);
case Permission.OWNER:
return this.permissionsService.isOwner(user, note);
return await this.permissionsService.isOwner(user, note);
}
return false;
}