Merge branch 'edge' of https://github.com/andresmanelli/wekan into andresmanelli-edge

This commit is contained in:
Lauri Ojansivu 2019-03-20 19:30:44 +02:00
commit dce89bcfa8
12 changed files with 202 additions and 43 deletions

View file

@ -6,6 +6,12 @@ allowIsBoardMember = function(userId, board) {
return board && board.hasMember(userId);
};
allowIsAnyBoardMember = function(userId, boards) {
return _.some(boards, (board) => {
return board && board.hasMember(userId);
});
};
allowIsBoardMemberCommentOnly = function(userId, board) {
return board && board.hasMember(userId) && !board.hasCommentOnly(userId);
};

View file

@ -525,3 +525,16 @@ Migrations.add('fix-circular-reference_', () => {
}
});
});
Migrations.add('mutate-boardIds-in-customfields', () => {
CustomFields.find().forEach((cf) => {
CustomFields.update(cf, {
$set: {
boardIds: [cf.boardId],
},
$unset: {
boardId: '',
},
}, noValidateMulti);
});
});

View file

@ -78,7 +78,7 @@ Meteor.publishRelations('board', function(boardId) {
this.cursor(Lists.find({ boardId }));
this.cursor(Swimlanes.find({ boardId }));
this.cursor(Integrations.find({ boardId }));
this.cursor(CustomFields.find({ boardId }, { sort: { name: 1 } }));
this.cursor(CustomFields.find({ boardIds: {$in: [boardId]} }, { sort: { name: 1 } }));
// Cards and cards comments
// XXX Originally we were publishing the card documents as a child of the