---
title: Displaying personalized content
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

Kentico allows you to personalize the displayed content based on the current user.

> **Note:** Checking the permissions of the current user allows only basic personalization. Use [Content personalization](https://docs.kentico.com/k8/on-line-marketing-features/content-personalization.md) to achieve more advanced personalization scenarios according to completely custom conditions.

> **Info:** **Personalization in short**
>
> 1. If you want to customize content displayed to the users, you need to grant or deny the READ permission to these users and turn on the **Check permissions** attribute of the appropriate web parts.
> 2. When the user is not authenticated, the system uses a special user **Public anonymous User (public)**.

## Example: Personalizing the Products menu

In this example, you will learn how to display the **Products** section only to members of the **Customers** and **Partners** roles and how to display the **Smartphones** category only to the members of the **Partners** role.

### Creating sample objects

First create object you will work with in this example:

1. Open the **Roles** application.
2. Select the _Corporate Site_ from the **Sites** drop‑down list and create new roles **Customers** and **Partners**.
3. Open the **Users** application and and create a new user **Customer1** with the following values:
   - **User name**: Customer1
   - **Full name**: Testing Customer
   - **Enabled**: yes (checked)
   - **Privilege level**: None
4. Assign the user to the _Corporate Site_ and to the **Customers** role.
5. Create another user **Partner1** with the following values:
   - **User name**: Partner1
   - **Full name**: Testing Partner
   - **Enabled**: yes (checked)
   - **Privilege level**: None
6. Assign the user to the _Corporate Site_ and to the **Partners** role.

### Assigning document-level permissions

Assign document-level permissions to the created roles:

1. Navigate to **Settings -> Security & Membership** and set **Check page permissions** to _All pages_.

   - This ensures that the security settings assigned in the following steps will be checked for all documents (pages) on the website.
2. Open the **Pages** application and select the root of the content tree.
3. Switch to the **Properties -> Security** tab.
4. Add the **Public anonymous user (public)** user and **Customers** and **Partners** roles to the list.
5. Grant the **Read** permissions to the user and roles.
   - Please note that you must click **Save** after assigning permissions to each user or role.

![Assigning document permissions to selected users and roles](https://docs.kentico.com/docsassets/k8/displaying-personalized-content/Document-level_permissions.png "Assigning document permissions to selected users and roles")

### Hiding selected child documents

Now hide the product categories from public users:

1. In the content tree, navigate to **/Products/Smartphones** and switch to the **Properties -> Security** tab.

   - The permissions that you configured for the root of the content tree are inherited by this document.
2. Click the **Change permission inheritance** link to break the inheritance.
3. In the following dialog, choose **Break inheritance and copy parent permissions**.
4. Select the **Public Anonymous User (public)** and deny the **Read** permission.
5. Repeat the previous steps for the **Laptops and Tablets** page.
6. Also deny the **Smartphones** page for the **Customers** role.

### Configuring web parts to check permissions

The permissions are not checked by web parts by default, so we need to configure the web parts so that they check the **Read** permission of the current user.

1. Choose the root in the content tree and switch to the **Design** tab.
2. Configure the **Top list menu** (CSS list menu) web part and select its **Check permissions** check-box in the **System settings**. Click **OK**.
3. Repeat the same for the **CSS list menu** and **Featured products** web parts on the **/Products** page.

### Verifying the result

Sign out. If you mouse-over the **Products** menu item as a public user, you will see that the sub-categories representing the restricted sections are no longer displayed.

![Public users do not have access to the restricted sections](https://docs.kentico.com/docsassets/k8/displaying-personalized-content/Restricted_products_menu.png "Public users do not have access to the restricted sections")

Sign in as user **Customer1** (using the mini‑form at the top right of the page). Navigate to **Products** via the main menu. As you can see, the **Smartphones** section and **Smartphone** products are not displayed to this user.

![Restricted section and products are not displayed to the user](https://docs.kentico.com/docsassets/k8/displaying-personalized-content/Products_page_Customer1.png "Restricted section and products are not displayed to the user")

Now sign out and sign in again as user **Partner1**. You will see all categories and products.

![All sections and products are displayed to this user](https://docs.kentico.com/docsassets/k8/displaying-personalized-content/Products_page_Partner1.png "All sections and products are displayed to this user")

You have learned how to personalize the content displayed to users based on their permissions.
