Explorar el Código

fix updateUserPermissions() on Sandstorm

The new isCommentOnly property needs to be set when
Sandstorm updates user permissions, because otherwise
a schema validation error occurs and users never get
added as members of boards.
David Renshaw hace 8 años
padre
commit
6db86489ab
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      sandstorm.js

+ 2 - 1
sandstorm.js

@@ -205,7 +205,8 @@ if (isSandstorm && Meteor.isServer) {
   function updateUserPermissions(userId, permissions) {
     const isActive = permissions.indexOf('participate') > -1;
     const isAdmin = permissions.indexOf('configure') > -1;
-    const permissionDoc = { userId, isActive, isAdmin };
+    const isCommentOnly = false;
+    const permissionDoc = { userId, isActive, isAdmin, isCommentOnly };
 
     const boardMembers = Boards.findOne(sandstormBoard._id).members;
     const memberIndex = _.pluck(boardMembers, 'userId').indexOf(userId);