Permalink
Browse files

Step 9.5: Add Parties collection security

  • Loading branch information...
1 parent 7375a9d commit 21407306f32267d65e6506ae29c1c3ce005d7c7e @kamilkisiela kamilkisiela committed with DAB0mB Sep 21, 2016
Showing with 11 additions and 0 deletions.
  1. +11 −0 both/collections/parties.collection.ts
@@ -1,5 +1,16 @@
import { MongoObservable } from 'meteor-rxjs';
+import { Meteor } from 'meteor/meteor';
import { Party } from '../models/party.model';
export const Parties = new MongoObservable.Collection<Party>('parties');
+
+function loggedIn() {
+ return !!Meteor.user();
+}
+
+Parties.allow({
+ insert: loggedIn,
+ update: loggedIn,
+ remove: loggedIn
+});

0 comments on commit 2140730

Please sign in to comment.