Meteor: 3.0.0-rc1 Package: allow-deny -> client side collection insert/update/remove not working as expected #13143
Labels
Meteor 3
relates to Meteor 3
Milestone
When executing the following line on the client with meteor 3, it should work since minimongo doesn't require async function calls.
Meteor.users.update(Meteor.userId(), { $set: { 'profile.ok': 1 }})
It generates this error on the server:
The reason is that in allow-deny.js of the AllowDeny package, the old method _validatedUpdate() is called but contains a findOne that is not Async.
Current Fix:
On our server code, we added this lines to override the deprecated function
Solution 1:
Update the code of _validatedInsert _validatedUpdate _validatedRemove in allow-deny.js to handle async methods
Solution 2 (better):
remove _validatedInsert _validatedUpdate _validatedRemove function and always use _validatedInsertAsync _validatedUpdateAsync _validatedRemoveAsync in both case update and updateAsync.
The text was updated successfully, but these errors were encountered: