summaryrefslogtreecommitdiffstats
path: root/models/lists.js
diff options
context:
space:
mode:
authorhuneau romain <huneau.romain@gmail.com>2017-05-11 12:15:02 +0200
committerhuneau romain <huneau.romain@gmail.com>2017-05-11 12:15:02 +0200
commitb5271e5346cde2563d36c64a300729e27336a86b (patch)
tree98d29cf0deeaeb8a6d337c8dff4b8cf9268541c6 /models/lists.js
parent548172949aaaea054f203d5fdc3286c90c5ae8e1 (diff)
downloadwekan-b5271e5346cde2563d36c64a300729e27336a86b.tar.gz
wekan-b5271e5346cde2563d36c64a300729e27336a86b.tar.bz2
wekan-b5271e5346cde2563d36c64a300729e27336a86b.zip
add token authentication, only admin can use api
Diffstat (limited to 'models/lists.js')
-rw-r--r--models/lists.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/models/lists.js b/models/lists.js
index a10e23b6..7dbdc9f2 100644
--- a/models/lists.js
+++ b/models/lists.js
@@ -132,6 +132,7 @@ if (Meteor.isServer) {
//LISTS REST API
if (Meteor.isServer) {
JsonRoutes.add('GET', '/api/boards/:boardId/lists', function (req, res, next) {
+ Authentication.checkUserId( req.userId);
const paramBoardId = req.params.boardId;
JsonRoutes.sendResult(res, {
code: 200,
@@ -145,6 +146,7 @@ if (Meteor.isServer) {
});
JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId', function (req, res, next) {
+ Authentication.checkUserId( req.userId);
const paramBoardId = req.params.boardId;
const paramListId = req.params.listId;
JsonRoutes.sendResult(res, {
@@ -154,6 +156,7 @@ if (Meteor.isServer) {
});
JsonRoutes.add('POST', '/api/boards/:boardId/lists', function (req, res, next) {
+ Authentication.checkUserId( req.userId);
const paramBoardId = req.params.boardId;
const id = Lists.insert({
title: req.body.title,
@@ -168,6 +171,7 @@ if (Meteor.isServer) {
});
JsonRoutes.add('DELETE', '/api/boards/:boardId/lists/:listId', function (req, res, next) {
+ Authentication.checkUserId( req.userId);
const paramBoardId = req.params.boardId;
const paramListId = req.params.listId;
Lists.remove({ _id: paramListId, boardId: paramBoardId });