diff options
Diffstat (limited to 'collections/avatars.js')
-rw-r--r-- | collections/avatars.js | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/collections/avatars.js b/collections/avatars.js deleted file mode 100644 index 53924ffb..00000000 --- a/collections/avatars.js +++ /dev/null @@ -1,27 +0,0 @@ -Avatars = new FS.Collection('avatars', { - stores: [ - new FS.Store.GridFS('avatars'), - ], - filter: { - maxSize: 72000, - allow: { - contentTypes: ['image/*'], - }, - }, -}); - -function isOwner(userId, file) { - return userId && userId === file.userId; -} - -Avatars.allow({ - insert: isOwner, - update: isOwner, - remove: isOwner, - download() { return true; }, - fetch: ['userId'], -}); - -Avatars.files.before.insert((userId, doc) => { - doc.userId = userId; -}); |