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

# Admin

Everything in <mark style="color:$primary;">config/admin.lua</mark>, plus how admin access is granted. Out of the box **nobody is an admin,** the resource never grants itself anything. The only exception is the server console, which always has full access, so you can never lock yourself out.

### Who is an admin

Access is granted with FiveM aces in `server.cfg`. For one person, grab their identifier (`license:`, `fivem:` and `steam:` all work) and add:

```cfg
add_ace identifier.license:ab12cd34ef56789 oph3z.admin allow
```

For a whole group:

```cfg
add_principal identifier.license:ab12cd34ef56789 group.admin
add_ace group.admin oph3z.admin allow
```

Being an admin in QBCore or ESX does **not** automatically put you in the `group.admin` ace principal - if the group line seems to do nothing, add the `add_principal` line or grant by identifier.

#### Admin groups

The quick route that skips `server.cfg`: every group listed here gets full access automatically when the resource starts. A group listed here always gets everything - the granular permissions below cannot restrict it.

```lua
Config.AdminGroups = { "group.admin" }
```

#### Granular permissions

Instead of the full `oph3z.admin`, hand out only what a rank should have. Every action checks its own permission on the server, and the panel hides what the person cannot do.

| Ace                       | What it allows                                                           |
| ------------------------- | ------------------------------------------------------------------------ |
| `oph3z.admin`             | everything below                                                         |
| `oph3z.admin.read`        | open the panel, view any inventory, search, item database, economy, logs |
| `oph3z.admin.give`        | give items, spawn from the item database, bulk give                      |
| `oph3z.admin.edit`        | move items, change amounts and metadata, remove single items, confiscate |
| `oph3z.admin.wipe`        | wipe an inventory, remove several items at once                          |
| `oph3z.admin.money`       | set a player's cash and bank                                             |
| `oph3z.admin.progression` | crafting xp, levels, skill points, recipes, daily limits                 |
| `oph3z.admin.manage`      | create, edit and remove shops, crafting stations, workbenches and items  |
| `oph3z.admin.bulk`        | give an item to everyone, a job or a gang                                |
| `oph3z.admin.forceopen`   | `/robplayer`, `/openinventoryplayer` and `/openstash` bypasses           |

```cfg
add_ace group.owner oph3z.admin allow

add_ace group.admin oph3z.admin.read allow
add_ace group.admin oph3z.admin.give allow
add_ace group.admin oph3z.admin.edit allow

add_ace group.mod oph3z.admin.read allow
```

To check it worked: type `/invadmin`, or look for the shield button next to the settings gear in the inventory. Aces granted in the live console can take up to 30 seconds to apply - the check is cached that long per session.

### Panel settings

`true` = admins see an admin button in the inventory top bar. The `/invadmin` command works either way.

```lua
Config.AdminPanel.button = true
```

The search panel scans memory first, then the whole database.

* `pageSize` - results per page.
* `maxResults` - hard stop for one scan, the panel says when it was reached.

```lua
search = {
    pageSize = 25,
    maxResults = 500
}
```

The Economy tab walks the whole database to show where items and money sit.

* `cacheMinutes` - a new scan only runs when the last one is older than this.
* `topHolders` - how many holders one item lists.
* `rarityFloor` - rare holdings and recent finds start at this tier.

```lua
economy = {
    cacheMinutes = 5,
    topHolders = 20,
    rarityFloor = "epic"
}
```

The dupe scan, run from the same database walk as the economy scan.

* `stackAlert` - flag any stack bigger than this.
* `stackAlerts` - per item limits for the ones that are legitimately huge.

```lua
integrity = {
    stackAlert = 1000,
    stackAlerts = {
        cash = 5000000,
        black_money = 5000000
    }
}
```

Destructive actions (wipes, mass removes, serial edits, restores) ask for a written reason that is saved to the log. This is the minimum length of that reason.

```lua
reasonMinLength = 3
```
