The Open Source kanban (built with Meteor). Keep variable/table/field names camelCase. For translations, only add Pull Request changes to wekan/i18n/en.i18n.json , other translations are done at https://transifex.com/wekan/wekan only.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
wekan/models/avatars.js

29 lines
495 B

Avatars = new FS.Collection('avatars', {
stores: [new FS.Store.GridFS('avatars')],
filter: {
maxSize: 520000,
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;
});
export default Avatars;