summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorJohannes May <johannes@may-se.de>2017-05-13 22:56:26 +0200
committerJohannes May <johannes@may-se.de>2017-05-13 22:56:26 +0200
commit0cf0f20f9d76fe711faaf7c4b245bf14f6e702ed (patch)
tree090b5d955941bf1797f7711ad28fa0e30356b443 /models
parente285632d9e33f9c346c476a4655f7eb208f84291 (diff)
downloadwekan-0cf0f20f9d76fe711faaf7c4b245bf14f6e702ed.tar.gz
wekan-0cf0f20f9d76fe711faaf7c4b245bf14f6e702ed.tar.bz2
wekan-0cf0f20f9d76fe711faaf7c4b245bf14f6e702ed.zip
Added /api/user/boards
Diffstat (limited to 'models')
-rw-r--r--models/boards.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/models/boards.js b/models/boards.js
index 879dde84..a0c0c8bf 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -556,6 +556,18 @@ if (Meteor.isServer) {
//BOARDS REST API
if (Meteor.isServer) {
+ JsonRoutes.add('GET', '/api/user/boards', function (req, res, next) {
+ // TODO: This should be changed to be less restrictive!
+ Authentication.checkUserId(req.userId);
+
+ return Boards.find({
+ archived: false,
+ 'members.userId': req.userId, // TODO: How does the current authentication system work? Can we rely on req.userId to be correct?
+ }, {
+ sort: ['title'],
+ });
+ });
+
JsonRoutes.add('GET', '/api/boards', function (req, res, next) {
Authentication.checkUserId(req.userId);
JsonRoutes.sendResult(res, {