mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
Merge pull request #2127 from bentiss/fix-set-member
api: fix set_board_member_permission
This commit is contained in:
commit
082aabc735
1 changed files with 7 additions and 2 deletions
|
@ -1140,9 +1140,14 @@ if (Meteor.isServer) {
|
|||
Authentication.checkBoardAccess(req.userId, boardId);
|
||||
const board = Boards.findOne({ _id: boardId });
|
||||
function isTrue(data){
|
||||
return data.toLowerCase() === 'true';
|
||||
try {
|
||||
return data.toLowerCase() === 'true';
|
||||
}
|
||||
catch (error) {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
board.setMemberPermission(memberId, isTrue(isAdmin), isTrue(isNoComments), isTrue(isCommentOnly), req.userId);
|
||||
const query = board.setMemberPermission(memberId, isTrue(isAdmin), isTrue(isNoComments), isTrue(isCommentOnly), req.userId);
|
||||
|
||||
JsonRoutes.sendResult(res, {
|
||||
code: 200,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue