Browse Source

7.2 Removed insecure, and allowed certain writes to posts.

Frederic G. MARAND 9 years ago
parent
commit
51def25630
3 changed files with 7 additions and 2 deletions
  1. 0 1
      .meteor/packages
  2. 0 1
      .meteor/versions
  3. 7 0
      lib/collections/posts.js

+ 0 - 1
.meteor/packages

@@ -11,4 +11,3 @@ underscore
 sacha:spin
 ian:accounts-ui-bootstrap-3
 accounts-password
-insecure

+ 0 - 1
.meteor/versions

@@ -20,7 +20,6 @@ htmljs@1.0.4
 http@1.1.0
 ian:accounts-ui-bootstrap-3@1.2.79
 id-map@1.0.3
-insecure@1.0.3
 iron:controller@1.0.8
 iron:core@1.0.8
 iron:dynamic-template@1.0.8

+ 7 - 0
lib/collections/posts.js

@@ -9,3 +9,10 @@
 
 // Not a "var", to make it global.
 Posts = new Mongo.Collection('posts');
+
+Posts.allow({
+  insert: function (userId, doc) {
+    // Only allow insert to logged-in users
+    return !!userId;
+  }
+});