> ## Documentation Index
> Fetch the complete documentation index at: https://docs.redutzu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Permissions

> Control what each job and rank can do in the MDT.

Permissions decide what an officer can do once the MDT is open. They're set per job and per grade, and saved in `config/permissions.json`.

## How access works

Two checks decide what an officer can do. Both must pass.

1. **Whitelist:** the officer's job must be whitelisted. Without it, the MDT doesn't open. See [Departments](https://docs.redutzu.com/redutzu-mdt/guides/departments.md).
2. **Permission:** the officer's grade must have the permission for the action, such as `incidents.create` to file an incident.

A whitelisted job with no permissions opens the MDT, but nothing in it unlocks.

> [!NOTE]
>
> Duty is a separate setting. With `Config.RequireDuty` on, officers must be on duty to open the MDT. It doesn't change which permissions a grade has.

## Grades inherit permissions

A permission applies to its grade **and every grade above it**. You never repeat a permission on higher grades.

```json config/permissions.json theme={null}
{
    "police": {
        "0": ["dashboard.view", "incidents.view", "incidents.create"],
        "1": ["incidents.delete"],
        "4": ["management.view", "management.permissions"]
    }
}
```

| Grade | Create incidents | Delete incidents | Open Management |
| - | - | - | - |
| `0` | Yes | No | No |
| `1` | Yes | Yes | No |
| `3` | Yes | Yes | No |
| `4` | Yes | Yes | Yes |

> [!TIP]
>
> Put each permission on the **lowest** grade that should have it. Grade `3` above has no list of its own and still inherits everything below it.

## Edit permissions

Pick the method that suits you. All three write to the same `config/permissions.json`, and changes made in game apply instantly.

> [tab] Admin panel
>
> Server admins can edit every job, without needing a job themselves.
>
> **1. Open the admin panel**
>
> Run `/mdtadmin` in game and open **Permissions**.
>
> **2. Pick a job**
>
> Choose the job you want to edit. Only whitelisted jobs are listed.
>
> **3. Set the lowest grade**
>
> For each permission, choose the lowest grade that gets it. Higher grades inherit it automatically.
>
> ![Permissions section of the admin panel with a job selected](https://mintcdn.com/redutzusscripts/jYySSRvwCjpWaAJk/images/guides/permissions-admin-panel.webp?fit=max\&auto=format\&n=jYySSRvwCjpWaAJk\&q=85\&s=0539268c9a74a45ef7cda3e06aa08892)
>
> Editing a job's permissions in the admin panel

> [tab] Management page
>
> Department leaders can edit their own job from inside the MDT.
>
> **1. Open Management**
>
> Open the MDT and go to **Management**, then the **Permissions** tab. You need `management.permissions`.
>
> **2. Set the lowest grade**
>
> For each permission, choose the lowest grade that gets it.
>
> ![Management page in the MDT with the Permissions tab open](https://mintcdn.com/redutzusscripts/jYySSRvwCjpWaAJk/images/guides/permissions-management.webp?fit=max\&auto=format\&n=jYySSRvwCjpWaAJk\&q=85\&s=8352e9a468bfa0f1eb8189de052749a2)
>
> The Permissions tab on the Management page
>
> Officers with `management.permissions.all` can also edit other departments.

> [tab] File
>
> Edit `config/permissions.json` and restart the resource.
>
> To apply the change without a restart, call [`ReloadPermissions`](https://docs.redutzu.com/redutzu-mdt/api-reference/exports/server#reloadpermissions) from the server console or another resource.
>
> > [!WARNING]
> >
> > The file must stay valid JSON. A missing or trailing comma stops all permissions from loading.

## Add a new job

When you whitelist a job in **Access** in the admin panel, you can copy the permissions of an existing job as a starting point. Then fine-tune them in **Permissions**.

To do it by hand, add the job to `Config.WhitelistedJobs`, then copy the `police` block in `config/permissions.json` and rename it. The grade numbers must match the job's grades in your framework.

```json config/permissions.json theme={null}
{
    "police": { "0": ["dashboard.view", "incidents.view"] },
    "sheriff": { "0": ["dashboard.view", "incidents.view"] }
}
```

## Your own permissions

A permission is just a string. Your own pages and scripts can use new ones, such as `wiki.view`.

* Add it to a grade in `config/permissions.json`, like any built-in permission. The in-game editors only list built-in permissions.
* Use your own prefix, such as `myplugin.view`, so it never clashes with a built-in permission.

To check a permission from your own server script, use [`HasAccess`](https://docs.redutzu.com/redutzu-mdt/api-reference/exports/server#hasaccess). It checks the whitelist and the permission together.

```lua server.lua theme={null}
local allowed = exports['redutzu-mdt']:HasAccess(source, 'myplugin.view', { duty = true })
```

## All permissions

> [accordion] Built-in permissions
>
> | Permission | What it allows |
> | - | - |
> | `dashboard.view` | See the dashboard overview and statistics. |
> | `incidents.view` | Open the incident list and read incident reports. |
> | `incidents.create` | File new incident reports. |
> | `incidents.update` | Edit incident reports, charges, and involved parties. |
> | `incidents.delete` | Permanently delete incident reports. |
> | `evidences.view` | Browse evidence and its chain of custody. |
> | `evidences.create` | Log new evidence items. |
> | `evidences.edit` | Edit evidence details and transfer custody. |
> | `evidences.delete` | Permanently delete evidence records. |
> | `evidences.lab` | Request and complete lab analyses on evidence. |
> | `stash.edit` | Manage stash contents linked to records. |
> | `officers.view` | See the officer roster and profiles. |
> | `officers.manage` | Edit officer details such as callsign and status. |
> | `bolos.view` | See active BOLOs. |
> | `bolos.create` | Issue new BOLOs. |
> | `bolos.edit` | Edit existing BOLOs. |
> | `bolos.delete` | Remove BOLOs. |
> | `dispatch.view` | Open the dispatch board and live alerts. |
> | `dispatch.alert.delete` | Dismiss dispatch alerts. |
> | `dispatch.assign` | Assign officers to dispatch alerts. |
> | `dispatch.channel.create` | Create dispatch radio channels. |
> | `dispatch.channel.connect` | Connect officers to dispatch channels. |
> | `dispatch.channel.delete` | Delete dispatch channels. |
> | `citizens.view` | Search citizens and read their profiles. |
> | `citizens.register` | Register new citizens. |
> | `citizens.edit` | Edit citizen profiles. |
> | `citizens.license.grant` | Grant licenses to citizens. |
> | `citizens.license.revoke` | Revoke licenses from citizens. |
> | `citizens.license.points` | Add or remove license points. |
> | `citizens.phone.records` | Read a citizen's phone records. |
> | `suspect.interact` | Use suspect interactions such as cuff, search, and escort. |
> | `units.join` | Join, leave, and start units, and set your unit's zone. |
> | `units.supervise` | Run every unit: move officers, set roles and statuses, merge units, page them, and send status checks. |
> | `gallery.edit` | Add and remove gallery images. |
> | `notes.delete` | Delete notes and HR notes written by others. Officers can always delete their own. |
> | `vehicles.view` | Search vehicles and read their details. |
> | `vehicles.register` | Register new vehicles. |
> | `vehicles.edit` | Edit vehicle details and flags. |
> | `houses.view` | Browse properties and owners. |
> | `houses.edit` | Edit property details. |
> | `weapons.view` | Browse registered weapons. |
> | `weapons.register` | Register new weapons. |
> | `weapons.edit` | Edit weapon details. |
> | `announcements.view` | Read announcements. |
> | `announcements.create` | Post new announcements. |
> | `announcements.update` | Edit announcements. |
> | `announcements.delete` | Delete announcements. |
> | `employees.view` | See the employee roster. |
> | `employees.fire` | Fire employees from the department. |
> | `employees.manage` | Change employee ranks and details. |
> | `employees.leaderboard.all` | See leaderboards across every department. |
> | `management.view` | Open the Management page. |
> | `management.recruit` | Recruit new employees. |
> | `management.permissions` | Edit rank permissions of your own department. |
> | `management.permissions.all` | Edit rank permissions of any department. |
> | `management.analytics.all` | View analytics and finances of any department. |
> | `management.achievements` | Create and edit achievements. |
> | `management.certifications` | Create and edit certifications. |
> | `management.tags` | Moderate and edit tags. |
> | `templates.view` | Browse report templates. |
> | `templates.manage` | Create, edit, and delete report templates. |
> | `logs.view` | Read the audit logs. |
> | `penalcode.view` | Read the penal code. |
> | `penalcode.create` | Add penal code entries. |
> | `penalcode.update` | Edit penal code entries. |
> | `penalcode.delete` | Remove penal code entries. |
> | `prisoners.view` | See who is in prison and how long they have left. |
> | `prisoners.release` | Release prisoners before their sentence ends. |
> | `prisoners.edit` | Change how long a prisoner still has to serve. |
> | `operationplans.view` | Read operation plans. |
> | `operationplans.create` | Draft new operation plans. |
> | `operationplans.update` | Edit operation plans. |
> | `operationplans.delete` | Delete operation plans. |
> | `warrants.view` | Read warrants. |
> | `warrants.create` | Issue new warrants. |
> | `warrants.edit` | Edit warrants. |
> | `warrants.delete` | Cancel and delete warrants. |
> | `radio.view` | See radio channels and members. |
> | `radio.create` | Create radio channels. |
> | `radio.update` | Edit radio channels. |
> | `radio.delete` | Delete radio channels. |
> | `radio.reassign` | Move officers between radio channels. |
> | `radio.codes` | Create, edit, and delete radio codes. |
> | `cameras.view` | See the camera list. |
> | `cameras.create` | Place new CCTV cameras. |
> | `cameras.delete` | Remove cameras. |
> | `cameras.connect` | Watch live camera feeds. |
> | `cameras.toggle` | Switch cameras on and off. |
> | `props.use` | Place officer props (cones, barriers...) and pick any of them back up. |
> | `k9.use` | Command your own K9 from the interactions menu. |
> | `chat.pin` | Pin chat messages. |
> | `chat.mention.everyone` | Mention everyone in chat. |
> | `chat.command.post` | Post announcements with chat commands. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.