bp123
bp123

Reputation: 3427

Autoform insert no restrictions

I'm trying to create a public autoform that gathers data. As a result, the people using the form don't have userIds. How do I create an insert form with no restrictions?

This is what I've previously used however it requires as user to be registered.

Collection.allow({
  insert: function(userId, doc) {
    return !!userId;
  },
});

Upvotes: 0

Views: 26

Answers (1)

Mikkel
Mikkel

Reputation: 7777

Just change it to this:

Collection.allow({
  insert: true,
});

Basically it allows anyone to insert a record to your database.

Upvotes: 2

Related Questions