Permalink
Browse files

Step 9.9: Check access to update a party

  • Loading branch information...
1 parent 8be029a commit b73e8722d6bfc83dc068b2f0de51f64073781c8a @kamilkisiela kamilkisiela committed with DAB0mB Sep 21, 2016
Showing with 7 additions and 1 deletion.
  1. +7 −1 client/imports/app/parties/party-details.component.ts
@@ -1,6 +1,7 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
-import { Subscription } from 'rxjs/Subscription';
+import { Subscription } from 'rxjs/Subscription';
+import { Meteor } from 'meteor/meteor';
import 'rxjs/add/operator/map';
@@ -33,6 +34,11 @@ export class PartyDetailsComponent implements OnInit, OnDestroy {
}
saveParty() {
+ if (!Meteor.userId()) {
+ alert('Please log in to change this party');
+ return;
+ }
+
Parties.update(this.party._id, {
$set: {
name: this.party.name,

0 comments on commit b73e872

Please sign in to comment.