summaryrefslogtreecommitdiffstats
path: root/models/rules.js
diff options
context:
space:
mode:
authorAngelo Gallarello <angelo.gallarell@gmail.com>2018-08-03 19:47:20 +0200
committerAngelo Gallarello <angelo.gallarell@gmail.com>2018-08-03 19:47:20 +0200
commitf63482b58775a2f52fdd5f932ce7d14f16757133 (patch)
tree886fdeae889b05ea009d67ed2181a5c46985f48a /models/rules.js
parentd5870472fbc988d1a4a4fcec0aa46544bbedefab (diff)
downloadwekan-f63482b58775a2f52fdd5f932ce7d14f16757133.tar.gz
wekan-f63482b58775a2f52fdd5f932ce7d14f16757133.tar.bz2
wekan-f63482b58775a2f52fdd5f932ce7d14f16757133.zip
UI for rules list
Diffstat (limited to 'models/rules.js')
-rw-r--r--models/rules.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/models/rules.js b/models/rules.js
new file mode 100644
index 00000000..2304d2dc
--- /dev/null
+++ b/models/rules.js
@@ -0,0 +1,38 @@
+Rules = new Mongo.Collection('rules');
+
+Rules.attachSchema(new SimpleSchema({
+ title: {
+ type: String,
+ optional: true,
+ },
+ description: {
+ type: String,
+ optional: true,
+ },
+}));
+
+Rules.mutations({
+ rename(description) {
+ return { $set: { description } };
+ },
+});
+
+Rules.allow({
+ update: function () {
+ // add custom authentication code here
+ return true;
+ },
+});
+
+
+
+
+if (Meteor.isServer) {
+ Meteor.startup(() => {
+ const rules = Rules.findOne({});
+ if(!rules){
+ Rules.insert({title: "regola1", description: "bella"});
+ Rules.insert({title: "regola2", description: "bella2"});
+ }
+ });
+}