diff options
author | Romulus Urakagi Tsai <urakagi@gmail.com> | 2020-05-20 15:11:22 +0800 |
---|---|---|
committer | Romulus Urakagi Tsai <urakagi@gmail.com> | 2020-05-20 15:11:22 +0800 |
commit | 4064f3f4063136c97aa7bcbcdc18fec923934b74 (patch) | |
tree | 730f644df43608576e302cd6699534ecea4984ff /models | |
parent | 09ce3e464fd609b3ecc8bec5263ab06093c3a442 (diff) | |
download | wekan-4064f3f4063136c97aa7bcbcdc18fec923934b74.tar.gz wekan-4064f3f4063136c97aa7bcbcdc18fec923934b74.tar.bz2 wekan-4064f3f4063136c97aa7bcbcdc18fec923934b74.zip |
Fix migrated attachment not readable bug
Remove reduandant files
Diffstat (limited to 'models')
-rw-r--r-- | models/attachments.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/models/attachments.js b/models/attachments.js index 1a55cb85..03999f55 100644 --- a/models/attachments.js +++ b/models/attachments.js @@ -6,7 +6,7 @@ const collectionName = 'attachments2'; Attachments = new FilesCollection({ storagePath: storagePath(), debug: false, - allowClientCode: true, +// allowClientCode: true, collectionName: 'attachments2', onAfterUpload: onAttachmentUploaded, onBeforeRemove: onAttachmentRemoving @@ -18,7 +18,17 @@ if (Meteor.isServer) { }); // TODO: Permission related - // TODO: Add Activity update + Attachments.allow({ + insert() { + return false; + }, + update() { + return true; + }, + remove() { + return true; + } + }); Meteor.methods({ cloneAttachment(file, overrides) { @@ -63,7 +73,7 @@ function storagePath(defaultPath) { } function onAttachmentUploaded(fileRef) { - Attachments.update({_id:fileRef._id}, {$set: {"meta.uploaded": true}}); + Attachments.update({_id:fileRef._id}, {$set: {"meta.uploading": false}}); if (!fileRef.meta.source || fileRef.meta.source !== 'import') { // Add activity about adding the attachment Activities.insert({ |