Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigok committed Jan 4, 2017
1 parent 41736d1 commit 856af6d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
14 changes: 0 additions & 14 deletions lib/fileUpload.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
/* globals UploadFS, Cookies, FileUpload */

if (UploadFS) {
RocketChat.models.Uploads.allow({
insert(userId/*, doc*/) {
return userId;
},

update(userId, doc) {
return userId === doc.userId;
},

remove(userId, doc) {
return userId === doc.userId;
}
});

const initFileStore = function() {
const cookie = new Cookies();
if (Meteor.isClient) {
Expand Down
15 changes: 14 additions & 1 deletion packages/rocketchat-file-upload/lib/FileUploadBase.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
/* globals FileUploadBase:true */
/* globals FileUploadBase:true, UploadFS */
/* exported FileUploadBase */

UploadFS.config.defaultStorePermissions = new UploadFS.StorePermissions({
insert: function(userId/*, doc*/) {
return userId;
},
update: function(userId, doc) {
return userId === doc.userId;
},
remove: function(userId, doc) {
return userId === doc.userId;
}
});


FileUploadBase = class FileUploadBase {
constructor(meta, file) {
this.id = Random.id();
Expand Down

0 comments on commit 856af6d

Please sign in to comment.