You can now specify a function for each rest method, which will be called right before the collection will be modified/queried. If you return false the action will be canceled, with returning true the action will take place. Editing the object before POST/PUT actions is also possible.

Example:

collectionApi.addCollection(ToDos, 'todos', {methods: ['POST', 'GET', 'PUT', 'DELETE'], before: {
	POST: function(todo) {
		if(todo.PropX === 'something') {
			todo.PropY = 'something else';
			return true;
		}
		return false;
	},

	GET: function(collectionID, todos) {
		for(i=0; i < todos.length;i++)
		{
			if(todos[i].Secret) {
				todos[i] = null;
			}
		}
		return true;
	},

	PUT: function(collectionID, todo, newValues) {
		if (todo.PropX === 'something')
		{
			return true;
		}
		return false;
	},

	DELETE: function(collectionID, todo) {
		if (todo.safe)
		{
			return false;
		}
		return true;
	}
}});

Signed-off-by: Andreas Glunz <andreas@mansion10.de>
now Meteorite friendly!
bumping version number for Meteorite / Atmosphere
I am not from the future. I promise.
fixed indentation
Pulled in fixes from #12 for meteor v0.6.0+
Metorite is the only way to go
fix a conflict