Php functions to restrict content

Are there php functions to control content within templates? I'm using Sensei to create a learning management site and need to put functions inside templates to show excerpts to non-registered users and full lessons to registered users. Do they exist?