| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- Rules = new Mongo.Collection('rules');
- Rules.attachSchema(new SimpleSchema({
- title: {
- type: String,
- optional: true,
- },
- triggerId: {
- type: String,
- optional: true,
- },
- actionId: {
- type: String,
- optional: true,
- },
- }));
- Rules.mutations({
- rename(description) {
- return { $set: { description } };
- },
- });
- Rules.helpers({
- getAction(){
- return Actions.findOne({_id:this.actionId});
- },
- });
- Rules.allow({
- update: function () {
- // add custom authentication code here
- return true;
- },
- remove: function () {
- // add custom authentication code here
- return true;
- },
- insert: function () {
- // add custom authentication code here
- return true;
- },
- });
|