1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

All: Fixes #6645: Do not encrypt non-owned note if it was not shared encrypted

This commit is contained in:
Laurent Cozic
2022-07-12 11:28:48 +01:00
parent 0b3c4edb92
commit 06d5feaa63
4 changed files with 14 additions and 4 deletions

View File

@ -207,7 +207,7 @@ export default class Resource extends BaseItem {
const share = resource.share_id ? await this.shareService().shareById(resource.share_id) : null;
if (!getEncryptionEnabled() || !itemCanBeEncrypted(resource as any)) {
if (!getEncryptionEnabled() || !itemCanBeEncrypted(resource as any, share)) {
// Normally not possible since itemsThatNeedSync should only return decrypted items
if (resource.encryption_blob_encrypted) throw new Error('Trying to access encrypted resource but encryption is currently disabled');
return { path: plainTextPath, resource: resource };