# Role-Based Security

**Role-Based Security** là cơ chế kiểm soát quyền truy cập dữ liệu trong **Data Model** dựa trên **role** của người dùng. Mỗi người dùng sẽ chỉ xem được những phần dữ liệu phù hợp với quyền hạn được cấp.

**Nguyên lý hoạt động**

* Người dùng được gán vào một hoặc nhiều **vai trò (roles).**
* Mỗi vai trò được thiết lập **quy tắc truy cập riêng** trong Data Model (theo dòng dữ liệu, theo schema, theo cột...)
* Khi người dùng truy cập báo cáo, hệ thống sẽ áp dụng **tự động các điều kiện lọc** phù hợp với vai trò của họ

#### Thiết lập Role-Base Security <a href="#id-4.2.5rolebasesecurity-tao-thietlaprolebasesecurity" id="id-4.2.5rolebasesecurity-tao-thietlaprolebasesecurity"></a>

{% stepper %}
{% step %}

#### Truy cập cấu hình Role-Based Security

Vào **Workspace** làm việc → mở **Data Model** cần thiết lập → chọn tab **Role-Based Security**.
{% endstep %}

{% step %}

#### Gán người dùng vào vai trò mặc định (Default Role)

Chọn **Default Role**, sau đó vào phần **Assignment** để thêm người dùng vào vai trò này. Nhấn **Lưu** để hoàn tất.

<figure><img src="/files/wi6mjnWDCKcOguCqxbp8" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Thiết lập điều kiện lọc cho Dataset

Chọn **Dataset** muốn áp dụng phân quyền → chuyển sang tab **Filters** → thêm các điều kiện lọc tương ứng cho vai trò → nhấn **Lưu**.

<figure><img src="/files/ImpsD0dsE8VjMfORb1gi" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


---

# 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.datasuite.vn/chia-se-va-quan-ly-truy-cap/phan-quyen/role-based-security.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.
