How would one go about showing a link on the front end if this entry belongs to the current user? I was thinking it had something to do with the UserModel's can()
, but I don't see any documentation of it.
Right now I'm showing an "Edit Page" link once someone is logged in, but I don't want to show a that link on a page that the current user doesn't have access to edit.
Any thoughts on this?
Edit
I was hoping something like this would work but it doesn't :( :
{% if entry.author == currentUser %}
<a class="btn btn-primary btn-small cp" href="{{ entry.getCpEditUrl() }}">Edit Page</a>
{% endif %}