Statamic provides flexible options for checking user login and permissions. This becomes particularly useful when you want to display links or navigation entries only if the user has the corresponding permission or status.
Use the following tag to verify a user's login status:
{{ if logged_in }}
You are logged in!
{{ /if }}
In the Statamic CMS, the administration area is referred to as the "Control Panel". Use the following tags to check within a template whether a user has access to it:
{{ user:can do="access cp" }}
<a href="/cp">Control Panel</a>
{{ /user:can }}
To display an editing link under an entry only if the user has the necessary rights, use the following tag:
{{ user:can do="edit blog entries" }}
<a href="{{ edit_url }}">Edit post</a>
{{ /user:can }}
In this example, blog
should be replaced with the name of the desired collection.