> For the complete documentation index, see [llms.txt](https://docs.datasuite.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datasuite.vn/chia-se-va-quan-ly-truy-cap/phan-quyen/role-based-security.md).

# 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 %}
