How to hide links for delete and edit

Hello. How do I hide the edit and delete buttons for my posts so that the user who created the post is the only one who can see the buttons.

I’m guessing the restriction would look like this within the template…

                      {{#if ownsPost}}

So that only the owner can see it. But how do I configure the code for “ownsPost”? How do I implement this feature.

You’re looking for template helpers.

For this kind of functionality I would suggest looking into the demo app:

Try find a tutorial that covers it. Should look something like this. This the helper for whatever template is handling the data.

ownPost: function() {
return this.userId == Meteor.userId();

{{#if ownsPost}} delete {{/if}}

isOwner: function() {
return true;//you can take any code here like mongo lookup

@sandeepmeenuga I just solved it. The code to use is…

         isOwner: function() {
         return this.userId === Meteor.userId();

But one you HAVE to set userId to Meteor.userId() with your event helper. Please mention this the next time. Thanks so much.