summaryrefslogtreecommitdiffstats
path: root/server/publications
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-08-23 11:09:48 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-08-26 19:59:44 +0200
commit48ac8b026ffdf8b3823c573e5693dcf1765383e2 (patch)
tree832576fddbcdef9810b206f1ee86469702497806 /server/publications
parent9faaf07e0257f622abcaa365408fa836a1cbdea8 (diff)
downloadwekan-48ac8b026ffdf8b3823c573e5693dcf1765383e2.tar.gz
wekan-48ac8b026ffdf8b3823c573e5693dcf1765383e2.tar.bz2
wekan-48ac8b026ffdf8b3823c573e5693dcf1765383e2.zip
Implement board archive and restoration
Diffstat (limited to 'server/publications')
-rw-r--r--server/publications/boards.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/server/publications/boards.js b/server/publications/boards.js
index 15825952..3f4f8e73 100644
--- a/server/publications/boards.js
+++ b/server/publications/boards.js
@@ -22,6 +22,7 @@ Meteor.publish('boards', function() {
}, {
fields: {
_id: 1,
+ archived: 1,
slug: 1,
title: 1,
color: 1,
@@ -30,6 +31,28 @@ Meteor.publish('boards', function() {
});
});
+Meteor.publish('archivedBoards', function() {
+ if (! Match.test(this.userId, String))
+ return [];
+
+ return Boards.find({
+ archived: true,
+ members: {
+ $elemMatch: {
+ userId: this.userId,
+ isAdmin: true
+ }
+ }
+ }, {
+ fields: {
+ _id: 1,
+ archived: 1,
+ slug: 1,
+ title: 1
+ }
+ })
+});
+
Meteor.publishComposite('board', function(boardId) {
check(boardId, String);
return {