# 角色(Role) 和 聯絡人(Contact) 的差異

## 概述

MaiAgent 提供兩種權限設定方式：**Contact-based** 和 **Role-based**，支援企業在不同場景下精確控制知識庫存取權限。

### Contact

在 MaiAgent 同步使用者資訊的儲存體，會建立 Contact ID 用以判斷使用者對話資訊。

{% hint style="info" %}
欲了解聯絡人資訊，請參考 [🌐聯絡人 (Contact) 介紹及串接↗](/tech/authorization-integration/contacts.md)
{% endhint %}

<figure><img src="/files/XH2bJouLh9x3ylurxUz9" alt=""><figcaption><p>未設定 Contact 姓名：用戶預設為匿名</p></figcaption></figure>

### Role

擁有編輯 AI 助理後臺權限之角色，企業內部可事先定義，如：客服人員、行政人員、實習生等。在機構內可事先建立角色可使用的權限及參考的資料庫，組織成員可根據需要選擇角色直接套用設定。

<figure><img src="/files/rJyrGajUeh5XuckifnIq" alt=""><figcaption><p>Role 使用者基本資料顯示</p></figcaption></figure>

## 一、權限方式對比

<figure><img src="/files/0ueDf9mVnM4EgNN3Ac6P" alt=""><figcaption><p>AI 助理嵌入畫面</p></figcaption></figure>

|        比較項目        |    Contact-based   |        Role-based        |
| :----------------: | :----------------: | :----------------------: |
|     🎯 **適用場景**    |      外部用戶、系統串接     |         內部用戶、組織管理        |
| 👤 **註冊 MaiAgent** |        ❌ 免註冊       |         ✅ 需註冊加入組織        |
|     📋 **建立方式**    |     系統自動建立或手動建立    |         預先定義角色模板         |
|     🔄 **更新機制**    |      動態同步使用者資訊     |         靜態角色權限設定         |
|     🎯 **使用目的**    |      判斷使用者對話資訊     | 套用預設權限設定，管理設定 AI 助理之後臺權限 |
|     👥 **適用對象**    |       外部訪客、會員      |         內部員工、組織成員        |
|     ⚙️ **管理方式**    |     透過 API 串接管理    |         透過後台角色管理         |
|     📊 **權限控制**    | 基於 Contact ID 動態控制 |       基於 Role 靜態控制       |

### 典型應用場景

**Contact-based 情境：適合需明確角色分工、權限定義的使用情境**

* **企業官網**：訪客依身份獲得不同產品資訊
* **會員中心**：依等級存取對應服務內容
* **客服中心**：依客戶類型提供差異化支援

**Role-based 情境**

* **內部作業**：員工依部門角色處理工作
* **客服團隊**：依職責範圍查詢知識庫
* **管理階層**：依權限進行內容審核維護

### 綜合使用策略

對外業務(不需要明確知道使用者身分者)適合使用 Contact-based 管理

對內業務(需要明確權限劃分 / 多個成員可用同一權限者)適合以 Role-based 管理

<figure><img src="/files/cyPkhnCc2mlwrd7JrIaC" alt=""><figcaption><p>Contact 與 Role 授權使用建議</p></figcaption></figure>


---

# 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.maiagent.ai/tech/authorization-integration/role-vs-contact.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.
