Due Cards and Broken Cards: In All Users view, fixed to show cards only from other users Public Boards. Not anymore from private boards.

Thanks to xet7 !

Related #1667
This commit is contained in:
Lauri Ojansivu 2021-01-11 05:23:11 +02:00
parent 82236484bc
commit 801d0aacf0
4 changed files with 24 additions and 22 deletions

View file

@ -93,14 +93,14 @@ Meteor.publish('dueCards', function(allUsers = false) {
let selector = {
archived: false,
};
// if user is not an admin allow her to see cards only from boards where
// for admins and users, allow her to see cards only from boards where
// she is a member
if (!user.isAdmin) {
selector.$or = [
{ permission: 'public' },
{ members: { $elemMatch: { userId: user._id, isActive: true } } },
];
}
//if (!user.isAdmin) {
selector.$or = [
{ permission: 'public' },
{ members: { $elemMatch: { userId: user._id, isActive: true } } },
];
//}
Boards.find(selector).forEach(board => {
permiitedBoards.push(board._id);
});
@ -180,14 +180,14 @@ Meteor.publish('brokenCards', function() {
const permiitedBoards = [null];
let selector = {};
// if user is not an admin allow her to see cards only from boards where
// for admins and users, if user is not an admin allow her to see cards only from boards where
// she is a member
if (!user.isAdmin) {
selector.$or = [
{ permission: 'public' },
{ members: { $elemMatch: { userId: user._id, isActive: true } } },
];
}
//if (!user.isAdmin) {
selector.$or = [
{ permission: 'public' },
{ members: { $elemMatch: { userId: user._id, isActive: true } } },
];
//}
Boards.find(selector).forEach(board => {
permiitedBoards.push(board._id);
});