> For the complete documentation index, see [llms.txt](https://mango-5m.gitbook.io/mango5m-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mango-5m.gitbook.io/mango5m-docs/resources/mango-prison/getting-started/jobs-and-permissions.md).

# Jobs & Permissions

The Corrections (doc) job, guard configuration, and the terminal permission grades.

## The Corrections job

`sql/jobs.sql` creates a dedicated **`doc`** (Department of Corrections) job:

| Grade | Name     |
| ----- | -------- |
| 0     | Cadet    |
| 1     | Officer  |
| 2     | Sergeant |
| 3     | Warden   |

Police and sheriff also count as guards by default. Configure who counts in `config/main.lua`:

```lua
Config.Guards = {
    jobs = { doc = 0, police = 0, sheriff = 0 },   -- job -> minimum grade
    ...
}
```

{% hint style="info" %}
The Bolingbroke MLO's roof-access doors already use a `doc` group in ox\_doorlock — the job name lines up on purpose, so corrections officers can open them with no extra setup.
{% endhint %}

{% hint style="warning" %}
`Config.Guards.jobs` grants **terminal and interaction access**. It is *not* the notification list — that is `Config.Announcements.notifyJobs` (default `doc` only), so adding police here doesn't subject them to prison PA announcements out in the city. See [Head Counts & PA](/mango5m-docs/resources/mango-prison/features/head-counts-and-pa.md).
{% endhint %}

## Terminal permission grades

Every terminal action has a minimum grade in `Config.Guards.grades`. Every action is re-validated **server-side** — including a physical distance check to a terminal — so a modified client cannot skip the UI.

| Permission   | Default grade | Gates                                                      |
| ------------ | ------------- | ---------------------------------------------------------- |
| `view`       | 0             | Dashboard, inmate database, records, cells view, audit log |
| `announce`   | 0             | PA broadcasts                                              |
| `headcount`  | 0             | Starting head counts                                       |
| `writeup`    | 0             | Issuing write-ups                                          |
| `cells`      | 0             | Assigning/moving inmates, locking single cells             |
| `visitation` | 1             | Revoking / restoring an inmate's visitation                |
| `lockdown`   | 1             | Lockdowns and the emergency page                           |
| `solitary`   | 1             | Solitary confinement                                       |
| `sentence`   | 2             | + / − time (also needs `allowSentenceEdit`)                |
| `timetable`  | 2             | Enabling/disabling timetable slots                         |

{% hint style="warning" %}
The **+ TIME / − TIME** buttons are disabled server-wide by default (`Config.Guards.allowSentenceEdit = false`). Sentences normally change only through jobs, write-ups and the courts. There is deliberately **no release button** — releases happen at sentence end, via the export/event, or `/prison release`.
{% endhint %}

## The prisoner job

While incarcerated, players hold the `prisoner` job (created by `jobs.sql`, configurable via `Config.PrisonerJob`). Their previous job and grade are stored and **restored automatically on release** — including for players who are released while offline (it finalises on their next login).

## The armoury

A quartermaster ped issues kit to corrections staff and logs every movement of it. Full detail: [**The Armoury**](/mango5m-docs/resources/mango-prison/features/the-armoury.md).

## Officer duty

Duty decides who shows as available on the terminal dashboard and who gets the officer HUD — manual clock-on at the reception desk by default, automatic if you prefer. Full detail: [**Officer Duty & HUD**](/mango5m-docs/resources/mango-prison/features/officer-duty-and-hud.md).
