mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 21:17:18 -04:00
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:
parent
82236484bc
commit
801d0aacf0
4 changed files with 24 additions and 22 deletions
|
@ -18,6 +18,8 @@ BlazeComponent.extendComponent({
|
|||
{ boardId: { $in: [null, ''] } },
|
||||
{ swimlaneId: { $in: [null, ''] } },
|
||||
{ listId: { $in: [null, ''] } },
|
||||
{ permission: 'public' },
|
||||
{ members: { $elemMatch: { userId: user._id, isActive: true } } },
|
||||
],
|
||||
};
|
||||
|
||||
|
|
|
@ -82,14 +82,14 @@ BlazeComponent.extendComponent({
|
|||
let selector = {
|
||||
archived: false,
|
||||
};
|
||||
// if user is not an admin allow her to see cards only from public boards
|
||||
// for every user including admin allow her to see cards only from public boards
|
||||
// or those 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);
|
||||
});
|
||||
|
|
|
@ -59,7 +59,7 @@ BlazeComponent.extendComponent({
|
|||
|
||||
myCardsSort() {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('sort:', Utils.myCardsSort());
|
||||
//console.log('sort:', Utils.myCardsSort());
|
||||
return Utils.myCardsSort();
|
||||
},
|
||||
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue