> For the complete documentation index, see [llms.txt](https://docs.otherplanet.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otherplanet.dev/scripts/op-clothing/tutorials/permissions.md).

# Permissions

{% hint style="info" %}
Every admin feature - the thumbnail generator, `/clothingadmin`, the shop editor, the job locker editor and custom ped management - shares **one** permission gate configured in `config/MainConfig.lua` under `Config.Permissions`.
{% endhint %}

## The gate

```lua
Config.Permissions = {
    AcePermission = 'op_clothing.admin',            -- ACE permission object
    AllowedGroups = { 'admin', 'superadmin', 'god' }, -- framework groups
}
```

A player passes the gate when **any** of these is true:

* They hold the `AcePermission` ACE, **or**
* Their framework group is in `AllowedGroups`, **or**
* The command is run from the **server console**.

## Option A - ACE permission (recommended)

ACE works on every framework and is independent of in-game jobs/groups. Add this to your `server.cfg`:

```
# allow a whole group
add_ace group.admin op_clothing.admin allow

# or allow a single identifier (license, steam, etc.)
add_principal identifier.license:xxxxxxxxxxxxxxxx group.admin
```

{% hint style="success" %}
If your admins are already in `group.admin` (txAdmin assigns this by default), the single `add_ace group.admin op_clothing.admin allow` line is all you need.
{% endhint %}

## Option B - framework groups

If you'd rather gate by your framework's group/permission, leave `AcePermission` as-is and edit `AllowedGroups` to match your setup:

```lua
AllowedGroups = { 'admin', 'superadmin', 'god' },
```

* **ESX** - matches the player's `group` (`admin`, `superadmin`, ...).
* **QBCore / Qbox** - matches the player's permission level (`admin`, `god`).

## Custom ped permission (separate)

Granting players access to **custom peds** is intentionally a different, narrower permission so you can hand it out without full admin rights. It lives in `config/CustomPeds.lua`:

```lua
AllowAce = 'op-clothing.customped.allow',
```

Holders of this ACE (or anyone who passes the main admin gate) can pick custom peds. Per-player grants are stored in the database and managed through these exports:

```lua
exports['op-clothing']:GrantCustomPedPermission(src)
exports['op-clothing']:RevokeCustomPedPermission(src)
local has = exports['op-clothing']:HasCustomPedPermission(src)
```

## What each feature checks

| Feature             | Command                  | Gate                                              |
| ------------------- | ------------------------ | ------------------------------------------------- |
| Clothing admin hub  | `/clothingadmin`         | `Config.Permissions`                              |
| Thumbnail generator | `/op_clothing_thumbs`    | `Config.Permissions`                              |
| Shop editor         | `/clothingadmin shops`   | `Config.Permissions`                              |
| Job locker editor   | `/clothingadmin lockers` | `Config.Permissions`                              |
| Custom peds         | `/charmenu`              | `Config.Permissions` **or** `CustomPeds.AllowAce` |

## Troubleshooting

* **"No access" in-game** - confirm the ACE line is in `server.cfg` and the player is in the right group, then `refresh` / reconnect.
* **Works in console but not in-game** - the console always passes; your in-game player is missing the ACE or group.
* **Changed the config but nothing changed** - restart op-clothing so the new `Config.Permissions` is loaded.
