Deny with meteor 3

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 ?

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