From ba24c4e40c728d030504ed21ccf79247d0449e1b Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Fri, 10 Jul 2020 18:56:26 +0300 Subject: All logged in users are now allowed to reorder boards by dragging at All Boards page and Public Boards page. Thanks to xet7 ! Fixes #3147 --- client/components/boards/boardsList.js | 6 ------ models/boards.js | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/client/components/boards/boardsList.js b/client/components/boards/boardsList.js index eee119ea..145f6789 100644 --- a/client/components/boards/boardsList.js +++ b/client/components/boards/boardsList.js @@ -25,10 +25,6 @@ BlazeComponent.extendComponent({ }, onRendered() { - function userIsAllowedToMove() { - return Meteor.user(); - } - const itemsSelector = '.js-board:not(.placeholder)'; const $boards = this.$('.js-boards'); @@ -77,8 +73,6 @@ BlazeComponent.extendComponent({ handle: '.board-handle', }); } - - $boards.sortable('option', 'disabled', !userIsAllowedToMove()); }); }, diff --git a/models/boards.js b/models/boards.js index 11d8fd89..f272e097 100644 --- a/models/boards.js +++ b/models/boards.js @@ -1219,6 +1219,14 @@ if (Meteor.isServer) { fetch: ['members'], }); + // All logged in users are allowed to reorder boards by dragging at All Boards page and Public Boards page. + Boards.allow({ + update(userId, board, fieldNames) { + return _.contains(fieldNames, 'sort'); + }, + fetch: [], + }); + // The number of users that have starred this board is managed by trusted code // and the user is not allowed to update it Boards.deny({ -- cgit v1.2.3-1-g7c22