|
@@ -37,16 +37,16 @@ Meteor.startup(() => {
|
|
error.statusCode = 403;
|
|
error.statusCode = 403;
|
|
throw error;
|
|
throw error;
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
// Helper function. Will throw an error if the user does not have read only access to the given board
|
|
// Helper function. Will throw an error if the user does not have read only access to the given board
|
|
Authentication.checkBoardAccess = function(userId, boardId) {
|
|
Authentication.checkBoardAccess = function(userId, boardId) {
|
|
Authentication.checkLoggedIn(userId);
|
|
Authentication.checkLoggedIn(userId);
|
|
|
|
|
|
const board = Boards.findOne({ _id: boardId });
|
|
const board = Boards.findOne({ _id: boardId });
|
|
- const normalAccess = board.permission === 'public' || board.members.some(e => e.userId === userId);
|
|
|
|
|
|
+ const normalAccess = board.permission === 'public' || board.members.some((e) => e.userId === userId);
|
|
Authentication.checkAdminOrCondition(userId, normalAccess);
|
|
Authentication.checkAdminOrCondition(userId, normalAccess);
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
});
|
|
});
|
|
|
|
|