mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
Merge branch 'master' of https://github.com/Robert-Lebedeu/wekan into Robert-Lebedeu-master
This commit is contained in:
commit
0649add494
3 changed files with 18 additions and 4 deletions
|
@ -2003,8 +2003,15 @@ if (Meteor.isServer) {
|
|||
req,
|
||||
res,
|
||||
) {
|
||||
Authentication.checkUserId(req.userId);
|
||||
// Check user is logged in
|
||||
Authentication.checkLoggedIn(req.userId);
|
||||
const paramBoardId = req.params.boardId;
|
||||
// Check user has permission to add card to the board
|
||||
const board = Boards.findOne({
|
||||
_id: paramBoardId
|
||||
});
|
||||
const addPermission = allowIsBoardMemberCommentOnly(req.userId, board);
|
||||
Authentication.checkAdminOrCondition(req.userId, addPermission);
|
||||
const paramListId = req.params.listId;
|
||||
const paramParentId = req.params.parentId;
|
||||
const currentCards = Cards.find(
|
||||
|
|
|
@ -283,8 +283,15 @@ if (Meteor.isServer) {
|
|||
'POST',
|
||||
'/api/boards/:boardId/cards/:cardId/checklists',
|
||||
function(req, res) {
|
||||
Authentication.checkUserId(req.userId);
|
||||
|
||||
// Check user is logged in
|
||||
Authentication.checkLoggedIn(req.userId);
|
||||
const paramBoardId = req.params.boardId;
|
||||
// Check user has permission to add checklist to the card
|
||||
const board = Boards.findOne({
|
||||
_id: paramBoardId
|
||||
});
|
||||
const addPermission = allowIsBoardMemberCommentOnly(req.userId, board);
|
||||
Authentication.checkAdminOrCondition(req.userId, addPermission);
|
||||
const paramCardId = req.params.cardId;
|
||||
const id = Checklists.insert({
|
||||
title: req.body.title,
|
||||
|
|
|
@ -58,7 +58,7 @@ Meteor.startup(() => {
|
|||
const board = Boards.findOne({ _id: boardId });
|
||||
const normalAccess =
|
||||
board.permission === 'public' ||
|
||||
board.members.some(e => e.userId === userId).isActive;
|
||||
board.members.some(e => e.userId === userId && e.isActive);
|
||||
Authentication.checkAdminOrCondition(userId, normalAccess);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue