> 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-horse-racing/permissions.md).

# Permissions

Control who can create and manage races in CAS Horse Racing — ace, group or everyone mode, enforced on the server so a modified client cannot get past it.

One setting controls who can create races, move their start time, delete them, and teleport to a start line. It is checked on the server, so a modified client cannot get past it.

Ordinary players never need permission. They can always open the menu, enter races, and place bets.

## Choose a mode

In `config.lua`:

```lua
Config.Permissions = {
    mode   = 'ace',
    ace    = 'cas.raceeditor',
    groups = { 'admin', 'superadmin' },
}
```

| mode       | Who gets access                                 |
| ---------- | ----------------------------------------------- |
| `ace`      | Anyone holding the ace. Recommended.            |
| `group`    | Anyone in one of the groups listed in `groups`. |
| `everyone` | Everybody. Test servers only.                   |

If you type a mode that does not exist, nobody gets access. This is deliberate.

## Using ace mode

Add one line to `server.cfg`:

```cfg
add_ace group.admin cas.raceeditor allow
```

To give it to a single person instead of a group:

```cfg
add_ace identifier.fivem:1234567 cas.raceeditor allow
```

To use a group you already have, swap the group name:

```cfg
add_ace group.moderator cas.raceeditor allow
```

Restart the server after editing `server.cfg`. To apply it without a restart, run this in the server console:

```
add_ace group.admin cas.raceeditor allow
```

## Using group mode

Set the mode and list your groups:

```lua
Config.Permissions = {
    mode   = 'group',
    groups = { 'admin', 'moderator' },
}
```

On VORP this reads the `group` column on the character. On RSG Core it asks the core for the permission. On standalone it always refuses, so use `ace` mode instead.

## Warning about everyone mode

`mode = 'everyone'` gives every player on your server the ability to:

* Create races anywhere on the map.
* Change when any race starts.
* Delete races.
* Teleport to a start line, if `Config.Editor.allowTeleport` is also on.

Use it only on a private test server.
