Checking permission for editing entries from inside template How do I check permission for editing entries belonging to a specific section?

When I try {{currentUser.can('editEntries:'~entry.sectionId) }}, it returns false - and I am sure that currentUser can edit entries from this section.

edit:
Its craft 3.1
In Craft 3.1, permissions checks are done based on uid now, not id.

This should work:

{{ currentUser.can('editEntries:'~entry.getSection().uid) }}