Hello,
I used to write this code in Meter 2.16 :
myCollection.deny({
insert() {
return true;
}, update() {
return true;
}, remove() {
return true;
}});
do I have to change it to this now for Meteor 3.x ?
myCollection.deny({
insert() {
return true;
},
insertAsync() {
return true;
},
update() {
return true;
},
updateAsync() {
return true;
},
remove() {
return true;
},
removeAsync() {
return true;
}
});
Thanks for your help.
Thanks.
When writing this :
myCollection.deny({
insert() {
return true;
},
insertAsync() {
return true;
},
update() {
return true;
},
updateAsync() {
return true;
},
remove() {
return true;
},
removeAsync() {
return true;
}
});
in Meteor 2.16 : I got this error :
Error: deny: Invalid key: insertAsync
W20240528-07:18:21.225(2)? (STDERR) at packages/allow-deny/allow-deny.js:474:13
Is it possible to integrate already in 2.x the possibility to write this so that we can smoothly migrate to 3.x ?
Thanks.
3 Likes
Does this PR will solve my problem ?
meteor:release-3.0
← meteor:allowdeny-async
opened 03:14PM - 29 May 24 UTC
This PR reviews the allow-deny package to make it async-compliant.
Two issues… have been reported by the community. Feel free to report any other issues in the comments for the next RC.
## Issue 1
Context: https://github.com/meteor/meteor/issues/13143
Client-side collection operations trigger server failures. The server uses the `_validate<OP>` sync method, causing the error `Error: findOne + is not available on the server. Please use findOneAsync() instead`.
We now enforce async validation with proper test coverage.
- [x] Provide test case and fix for proper operation with async validation
## Issue 2
Context: https://forums.meteor.com/t/meteor-3-0-rc-1-is-out/61580/9
Async definitions on allow/deny rules don't work.
- [x] Provide test case and fix for async definitions on allow/deny rules.
This is surely a migration tool useful for 2.0 to migrate to 3.0. However, that PR you linked is based on 3.0. That needs to be addressed as part of the next 2.17, which is not expected to be released soon, or at least after the official Meteor 3.0 release.
Taking a note on this anyway to consider for 2.17.
1 Like