Object has no method 'permit' after adding package.
cpalanzo opened this issue · 6 comments
Added basic package. Used standard permit construct on existing collection in common.js code.
Did this after attachSchema to insure collection exists.
Permit method NOT added to collection.
terminal log attached
-------- Common.js ------------
Trips = new Mongo.Collection("trip_db");
console.log("creating Customers collection");
Customers = new Mongo.Collection("customers_db");
SimpleSchema.debug = true;
var Schemas = {};
Schemas.Customer = new SimpleSchema({
organization: {
type: String,
label: "Organization",
max: 200
},
admin_email: {
type: String,
label: "Admin Email"
},
locations:
{
type: String,
label: "Location",
max: 40
}
});
console.log("my Customer Schemas " + Schemas.Customer);
Customers.attachSchema(Schemas.Customer);
// Use ongoworks/security Any client may insert, update, or remove a post without restriction
Customers.permit(['insert', 'update', 'remove']).apply();
// Use standard allow - always return true to start - NO user validation yet
Customers.allow ({
insert: function (userId, document) {
console.log (' Customers.allow (): userId: ', userId, '; document: ', document, ' created by ', document.createdBy);
return true;
}
});
Try removing houston:admin
. I think that pkg messes with Mongo.Collection somehow. Might want to submit an issue with them.
Or just put ongoworks:security
before houston:admin
in your packages file.
That's the other error I've seen when houston:admin is in use. You'll have to remove it or get them to fix it I guess. You might want to try using yogiben:admin instead.
Thanks... I'll houston - I don't use it that often. I'll probably post an issue to see if they address it. What's the best way to word it - given what you've seen?
I'm sure you can state my case more clearly with a "Meteor"ic accent!
Thanks for your help.
I haven't investigated much, but I guess I'd tell them that their package seems to make other packages unable to recognize a Mongo.Collection
object. It's somehow overriding or fiddling with the prototype.