> For the complete documentation index, see [llms.txt](https://alt0.gitbook.io/alt0-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alt0.gitbook.io/alt0-docs/alt0-mdt/permissions.md).

# Permissions

Decide which rank may do what in ALT0 MDT.

Every action in the MDT is checked on the server against `Config.Permissions` in `config.lua`.

## How a rule reads

| Rule                                     | Meaning                                                               |
| ---------------------------------------- | --------------------------------------------------------------------- |
| `0`, `1`, `2`...                         | Minimum job grade level. Applies to police and sheriff.               |
| `'command'`                              | Command rank: the job's boss flag, or `Config.CommandGrade` and up    |
| `{ grade = 1, agencies = { 'police' } }` | A grade for specific agencies only (`'police'`, `'sheriff'`, `'ems'`) |

## Defaults

```lua
Config.Permissions = {
    ['records.view']     = 0,
    ['reports.write']    = 0,
    ['reports.edit_any'] = 2,
    ['reports.delete']   = 3,
    ['incidents.write']  = 0,
    ['charges.write']    = 0,
    ['warrants.request'] = 0,
    ['warrants.approve'] = 3,
    ['warrants.revoke']  = 3,
    ['vehicles.flag']    = 0,
    ['profiles.notes']   = 0,
    ['profiles.tags']    = 1,
    ['licenses.manage']  = 2,
    ['evidence.add']     = 0,
    ['evidence.remove']  = 3,
    ['weapons.flag']     = 0,
    ['cases.write']      = 0,
    ['cases.close']      = 2,
    ['bolo.write']       = 0,
    ['docket.write']     = 2,
    ['penalcode.manage'] = 'command',
    ['roster.manage']    = 'command',
    ['officers.files']   = 3,
    ['logs.view']        = { grade = 'command', agencies = { 'police', 'sheriff', 'ems' } },
    ['ems.records']      = { grade = 0, agencies = { 'ems' } },
    ['finance.audit']    = { grade = 1, agencies = { 'police' } },
    ['finance.freeze']   = { grade = 3, agencies = { 'police' } },
}
```

## What each permission covers

| Permission                                                | Allows                                                                                                                  |
| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `records.view`                                            | Search and open citizen, vehicle and weapon records                                                                     |
| `reports.write`, `reports.edit_any`, `reports.delete`     | Write reports, edit other officers' reports, delete reports                                                             |
| `incidents.write`                                         | Create and edit incidents                                                                                               |
| `charges.write`                                           | Add charges and process arrests                                                                                         |
| `warrants.request`, `warrants.approve`, `warrants.revoke` | Request, approve and revoke warrants. With `Config.WarrantApproval`, requests wait for someone with `warrants.approve`. |
| `vehicles.flag`, `weapons.flag`                           | Flag vehicles and weapons                                                                                               |
| `profiles.notes`, `profiles.tags`                         | Write profile notes, set warning tags                                                                                   |
| `licenses.manage`                                         | Grant and revoke licences                                                                                               |
| `evidence.add`, `evidence.remove`                         | Add evidence, remove evidence                                                                                           |
| `cases.write`, `cases.close`                              | Create and edit cases, close cases                                                                                      |
| `bolo.write`                                              | Create BOLOs                                                                                                            |
| `docket.write`                                            | Manage the court docket                                                                                                 |
| `penalcode.manage`                                        | Edit the penal code                                                                                                     |
| `roster.manage`                                           | Manage the roster                                                                                                       |
| `officers.files`                                          | Open personnel files                                                                                                    |
| `logs.view`                                               | Read the MDT audit log                                                                                                  |
| `ems.records`                                             | EMS patient records                                                                                                     |
| `finance.audit`, `finance.freeze`                         | Run a [financial audit](/alt0-docs/alt0-mdt/financial-audit.md), freeze a person's accounts                             |

## Examples

Let sheriffs run financial audits too:

```lua
['finance.audit'] = { grade = 1, agencies = { 'police', 'sheriff' } },
```

Only command staff may close cases:

```lua
['cases.close'] = 'command',
```
