Now only show edit and add buttons to writers, not readers
This commit is contained in:
@@ -11,6 +11,18 @@ Template.baseDialog.helpers({
|
||||
editing: function(){
|
||||
return Template.instance().editing.get();
|
||||
},
|
||||
showEdit: function() {
|
||||
if (this.hideEdit) return false;
|
||||
var charId = Template.parentData().charId;
|
||||
if (charId){
|
||||
var char = Characters.findOne(charId);
|
||||
var userId = Meteor.userId();
|
||||
if (char && userId)
|
||||
return char.owner === userId ||
|
||||
_.contains(char.writers, userId);
|
||||
}
|
||||
return true;
|
||||
},
|
||||
});
|
||||
|
||||
Template.baseDialog.events({
|
||||
|
||||
Reference in New Issue
Block a user