> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-chat-v2/permissions.md).

# Staff permissions

Grant staff in CAS Chat V2 — by config identifier, by ACE permission, or by framework group. Staff get the badge, the staff channel, the moderation panel and flood exemption.

Staff get a badge next to their name, the Staff tab and `/staff` channel, the moderation panel, and exemption from flood protection, slow mode and the OOC lock.

## Granting staff from the config

This is the recommended way. You do not need to touch `server.cfg`.

Open `config.lua` and add the player's identifier:

```lua
Config.Staff = {
    ['fivem:1742814'] = 'Owner',
    ['discord:123456789012345678'] = 'Admin',
    ['license:1a2b3c4d5e6f7890'] = 'Moderator',
}
```

Then run `restart rsm_rpchat`.

### Finding an identifier

The player joins the server and types:

```
/rpchat_id
```

Their identifiers appear in their own chat. Nobody else sees them, and the IP address is never shown. Any identifier from that list works. The player copies one and sends it to you.

The command needs no permission, so a player can look up their own identifier before you have made them staff.

### Notes

* All of a player's identifiers are checked, so it does not matter which type you put in the list.
* Matching ignores upper and lower case.
* The label is free text. `Owner`, `Admin`, `Head Moderator` and anything else all work, and the label is what appears on the badge.

## Other ways to grant staff

The staff label is looked up in this order and the first match wins.

**1. `Config.Staff`**, the list above.

**2. `Config.StaffAces`**, ACE permissions. Use this if you already manage staff through `server.cfg`.

```lua
Config.StaffAces = {
    { ace = 'rpchat.owner', label = 'Owner' },
    { ace = 'rpchat.admin', label = 'Admin' },
    { ace = 'rpchat.mod', label = 'Moderator' },
    { ace = 'rpchat.support', label = 'Support' },
}
```

In `server.cfg`:

```
add_ace group.admin rpchat.admin allow
```

Note that a general `add_ace group.admin command allow` does not cover this. The ACE object has to be granted by name.

**3. The framework group or permission.**

On VORP the user group and the character group are both checked against:

```lua
Config.VorpStaffGroups = {
    admin = 'Admin',
    moderator = 'Moderator',
    mod = 'Moderator',
    support = 'Support',
}
```

On RSG the permissions are checked in order through `HasPermission`:

```lua
Config.RsgStaffPermissions = {
    { perm = 'god', label = 'Owner' },
    { perm = 'admin', label = 'Admin' },
    { perm = 'mod', label = 'Moderator' },
}
```

The names on the left have to match the group and permission names your framework actually uses.

## Removing staff

Delete the line from `Config.Staff` and run `restart rsm_rpchat`. The restart re-syncs every connected player, so the change applies straight away and nobody has to reconnect.
