Now only show edit and add buttons to writers, not readers

This commit is contained in:
Stefan Zermatten
2015-05-12 11:34:37 +02:00
parent ff8ae89722
commit bf032bcdf3
11 changed files with 68 additions and 36 deletions

View File

@@ -0,0 +1,6 @@
Template.registerHelper("canEditCharacter", function(charId) {
var char = Characters.findOne(charId)
var userId = Meteor.userId();
return char.owner === userId ||
_.contains(char.writers, userId);
});