浏览代码

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
Lauri Ojansivu 5 年之前
父节点
当前提交
ba24c4e40c
共有 2 个文件被更改,包括 8 次插入6 次删除
  1. 0 6
      client/components/boards/boardsList.js
  2. 8 0
      models/boards.js

+ 0 - 6
client/components/boards/boardsList.js

@@ -25,10 +25,6 @@ BlazeComponent.extendComponent({
   },
   },
 
 
   onRendered() {
   onRendered() {
-    function userIsAllowedToMove() {
-      return Meteor.user();
-    }
-
     const itemsSelector = '.js-board:not(.placeholder)';
     const itemsSelector = '.js-board:not(.placeholder)';
 
 
     const $boards = this.$('.js-boards');
     const $boards = this.$('.js-boards');
@@ -77,8 +73,6 @@ BlazeComponent.extendComponent({
           handle: '.board-handle',
           handle: '.board-handle',
         });
         });
       }
       }
-
-      $boards.sortable('option', 'disabled', !userIsAllowedToMove());
     });
     });
   },
   },
 
 

+ 8 - 0
models/boards.js

@@ -1219,6 +1219,14 @@ if (Meteor.isServer) {
     fetch: ['members'],
     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
   // The number of users that have starred this board is managed by trusted code
   // and the user is not allowed to update it
   // and the user is not allowed to update it
   Boards.deny({
   Boards.deny({