I have a helper like
Template.user_profile.helpers({
user:function() {
return Meteor.users.find({\'profile.front_name\':Session.get(\'slug\')}).fetch(
maybe this would work for you:
//js
Template.foo.helpers({ bar: function() {
return this.userId == Meteor.userId(); },
domain: function() {
var a = document.createElement('a'); a.href = this.url;
return a.hostname;
} });
ownsDocument = function(userId, doc) { return doc && doc.userId === userId;}
Posts = new Meteor.Collection('posts');
Posts.allow({
update: ownsDocument, remove: ownsDocument
});
//html
{{#if bar}}Edit{{/if}}