# RLS on PowerPilot

To restrict access to certain report data based on user credentials, Power Pilot now also supports Row Level Security (RLS).

With this feature, if your dataset is configured with the DAX CUSTOMDATA() function and users have access to Power Pilot, security filters will be applied, ensuring that each user sees only the information relevant to them, which enhances data security.

### **How It Works**

Unlike standard RLS, which uses the USERNAME() or USERPRINCIPALNAME() functions, Power Pilot uses the CUSTOMDATA() function. This function is easy to configure and allows effective control over the data visible to each user.

### **Configuration in Power BI Desktop**

In Power BI Desktop, two RLS configurations are required:

1. **Rule**: Use the USERNAME() or USERPRINCIPALNAME() functions to create filters based on a user table. This configuration is essential for dynamic RLS.
2. **Rule**:Use the same table to filter, but now pass the CUSTOMDATA() function to apply the filter.

{% hint style="warning" %}
Dynamic RLS configuration is a prerequisite for CUSTOMDATA() configuration. Static RLS is not compatible with this scenario.
{% endhint %}

Dynamic RLS Configuration: Configure dynamic RLS by passing USERNAME() or USERPRINCIPALNAME() as the function.

<figure><img src="/files/KwXm1c23OwOKz7agllFZ" alt=""><figcaption></figcaption></figure>

Power Pilot RLS Configuration: Use the CUSTOMDATA() function

<figure><img src="/files/5mOPuy7OmYSFpcqT1LDJ" alt=""><figcaption></figcaption></figure>

Once the RLS is created, simply publish the report to the Power BI service.

### **Configuration in Power Embedded**<br>

To configure Power Pilot RLS, go to the admin portal, Artifacts > Datasets > Reload.

<figure><img src="/files/TlAPuDp8tFmgOZpggOrw" alt=""><figcaption></figcaption></figure>

After reloading the dataset, search for the dataset that had RLS configured, click on Actions > Security.\
To configure the rule, follow two steps:

1° **Step**: In the Dynamic Security menu, select the configured function.<br>

<figure><img src="/files/BVXQNR5ae3B2zLB8xeOk" alt=""><figcaption></figcaption></figure>

In the Power Pilot Security menu, select the CUSTOMDATA() function.

<figure><img src="/files/1xYOzKevDJ2RqbKfENfI" alt=""><figcaption></figcaption></figure>

After these configurations, Power Pilot will have RLS properly configured, and each user will see only the information relevant to them.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.powerembedded.com/administration-portal/power-pilot-ai/rls-on-powerpilot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
