mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Fixed REST API, it shoud work now by Admin user.
Reverted Allow board members to use more of API of Wekan v5.35
a719e8fda1
Thanks to tomhughes.
Fixes #4009,
fixes #2793,
fixes #2790
This commit is contained in:
parent
5b5094ced6
commit
e3a0dea85f
8 changed files with 38 additions and 45 deletions
|
@ -467,8 +467,8 @@ if (Meteor.isServer) {
|
|||
*/
|
||||
JsonRoutes.add('GET', '/api/boards/:boardId/lists', function(req, res) {
|
||||
try {
|
||||
Authentication.checkUserId(req.userId);
|
||||
const paramBoardId = req.params.boardId;
|
||||
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
||||
|
||||
JsonRoutes.sendResult(res, {
|
||||
code: 200,
|
||||
|
@ -502,9 +502,9 @@ if (Meteor.isServer) {
|
|||
res,
|
||||
) {
|
||||
try {
|
||||
Authentication.checkUserId(req.userId);
|
||||
const paramBoardId = req.params.boardId;
|
||||
const paramListId = req.params.listId;
|
||||
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
||||
JsonRoutes.sendResult(res, {
|
||||
code: 200,
|
||||
data: Lists.findOne({
|
||||
|
@ -531,8 +531,8 @@ if (Meteor.isServer) {
|
|||
*/
|
||||
JsonRoutes.add('POST', '/api/boards/:boardId/lists', function(req, res) {
|
||||
try {
|
||||
Authentication.checkUserId(req.userId);
|
||||
const paramBoardId = req.params.boardId;
|
||||
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
||||
const board = Boards.findOne(paramBoardId);
|
||||
const id = Lists.insert({
|
||||
title: req.body.title,
|
||||
|
@ -569,8 +569,8 @@ if (Meteor.isServer) {
|
|||
res,
|
||||
) {
|
||||
try {
|
||||
Authentication.checkUserId(req.userId);
|
||||
const paramBoardId = req.params.boardId;
|
||||
Authentication.checkBoardAccess(req.userId, paramBoardId);
|
||||
const paramListId = req.params.listId;
|
||||
Lists.remove({ _id: paramListId, boardId: paramBoardId });
|
||||
JsonRoutes.sendResult(res, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue