Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Sam X. Chen 2019-08-29 22:08:41 -04:00
commit 58155288fb
100 changed files with 6452 additions and 539 deletions

View file

@ -407,10 +407,7 @@ Boards.helpers({
},
lists() {
return Lists.find(
{ boardId: this._id, archived: false },
{ sort: { sort: 1 } },
);
return Lists.find({ boardId: this._id }, { sort: { sort: 1 } });
},
nullSortLists() {

View file

@ -258,9 +258,14 @@ Users.attachSchema(
);
Users.allow({
update(userId) {
const user = Users.findOne(userId);
return user && Meteor.user().isAdmin; // GitHub issue #2590
update(userId, doc) {
const user = Users.findOne({ _id: userId });
if ((user && user.isAdmin) || (Meteor.user() && Meteor.user().isAdmin))
return true;
if (!user) {
return false;
}
return doc._id === userId;
},
remove(userId, doc) {
const adminsNumber = Users.find({ isAdmin: true }).count();