# Role Mapping

## Mapping Discord Roles and CMS Ranks

In the `Administration` panel of the CMS, navigate to `Integrations` > `Discord` > `Role Mapping`

Configure your CMS x Discord [One-to-One](#one-to-one-mapping) and [Category](#category-mapping) mappings below.

## One-to-One Mapping

<figure><img src="/files/IzEaDSFz2fnxbX3iSetl" alt="" width="375"><figcaption><p>CMS x Discord: One-to-One Mapping</p></figcaption></figure>

<details>

<summary>One-to-One Mapping Explained</summary>

One-to-one mapping allows you to map a CMS rank to one or more Discord roles. Adding or removing a one-to-one mapped rank in the CMS will add or remove the Discord role and vice versa.

This mapping type is the most common.

* CMS: `Admin` rank
* Discord: `Admin` role in one or more Discord guilds

![](/files/CTUhaF0ljRE2dKolfTYE)

</details>

## Category Mapping

<figure><img src="/files/w0qwOG1ROllEBhgwJJsy" alt="" width="375"><figcaption><p>CMS x Discord: Category Mapping</p></figcaption></figure>

<details>

<summary>Category Mapping Explained</summary>

Category mapping allows you to map multiple CMS ranks to a single Discord role. If a user has any of the CMS ranks they will receive the Discord role. If a user has none of the CMS ranks the Discord role will be removed.

This mapping type is best used for role categories.

* CMS: Multiple staff ranks `Moderator`, `Admin` and `Director`
* Discord: A general `Staff` role

![](/files/jGQvoLZ9o2KQ9bNAFI0D)

</details>

## Syncing the Role Map

{% hint style="info" %}
After modifying the mapping, your community will automatically be re-synced.\
This may take a couple of minutes to complete.
{% endhint %}

While changes are automatic, you can also manually re-sync users with the `/sync` command.

Setting the flag `community` to `Yes` will sync your entire community including any linked guilds. Setting it to no or running `/sync` by itself will only sync the server you run it in.


---

# 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.sonoransoftware.com/bot/tutorials/sonoran-cms-integration/role-mapping.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.
