Skip to main content


The function check_auth can be used to know if the user is granted to view something.

{check_auth role="CUSTOMER" login_tpl="login"}

{check_auth resource="admin.address" access="VIEW" login_tpl="login"}


A user can only have one of these two roles:

  • ADMIN : an administrator of the site
  • CUSTOMER : a registed and logged in customer


This argument is the name of the view name (the login page is “login”). If the user is not granted and this argument is defined, it redirects to this view.


The resource argument may be useful in the back office. There is the list of the available resources in Thelia 2:

  • admin.address
  • admin.configuration.administrator
  • admin.configuration.advanced
  • admin.configuration.area
  • admin.configuration.attribute
  • admin.category
  • admin.configuration
  • admin.content
  • admin.configuration.currency
  • admin.customer
  • admin.configuration.feature
  • admin.folder
  • admin.home
  • admin.configuration.language
  • admin.configuration.mailing-system
  • admin.configuration.message
  • admin.module
  • admin.order
  • admin.product
  • admin.configuration.profile
  • admin.configuration.shipping-zone
  • admin.configuration.template
  • admin.configuration.system-logs
  • admin.configuration.admin-logs
  • admin.configuration.translations
  • admin.configuration.update
  • admin.export
  • admin.export.customer.newsletter


Name of the module which the user must have access to. Example:

    {check_auth role="ADMIN" module="Carousel" access="UPDATE" login_tpl="login"}


There is 4 types of access to a resource:

  • CREATE : create a new entry
  • VIEW : view the resource
  • UPDATE : update the resource
  • DELETE : delete the resource

Those accesses can be configured from the back office, tab “Configuration”, on “Administration Profile”.