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

# Permissions and duty

> Create staff ranks, inherit permissions, protect sensitive actions, and manage duty.

YB Admin uses server-side groups, inheritance, and action-level permissions. UI visibility improves clarity, but the server remains the authority.

## Default groups

| Group       | Level | Inherits  | Intended access                                                                       |
| ----------- | ----: | --------- | ------------------------------------------------------------------------------------- |
| Helper      |    10 | —         | Reports, staff chat, player viewing, direct messages, and return teleport             |
| Moderator   |    20 | Helper    | Revive, freeze, jail, monitoring, screenshots, kicks, noclip, and logs                |
| Admin       |    30 | Moderator | Bans, inventories, money, jobs, gangs, items, resources, economy, and developer tools |
| Developer   |    35 | Admin     | Developer tools and resource management                                               |
| Super Admin |    40 | Admin     | Character removal, announcements, weather, cleanup, and log clearing                  |
| Owner       |   100 | —         | Full access through `*`                                                               |

Default groups are defined in `Config.Groups` inside `editable/server.lua`. You can edit them before first start or manage groups from the panel.

## Permission inheritance

Use `inherit` to include every permission from a lower group:

```lua theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
    name = 'mod',
    label = 'Moderator',
    level = 20,
    inherit = 'helper',
    permissions = {
        'admin.players.revive',
        'admin.players.freeze',
        'admin.players.kick',
    },
}
```

<Warning>
  A group cannot safely inherit from a group at the same or a higher level. Keep the inheritance chain moving upward in power.
</Warning>

## Permission categories

<AccordionGroup>
  <Accordion title="Core" icon="layout-dashboard">
    `admin.open`, dashboard access, announcements, weather, cleanup, and group management.
  </Accordion>

  <Accordion title="Players" icon="users">
    Player viewing, names, heal, revive, freeze, kill, kick, ban, skin, messages, jail, evidence, inventory, money, job, gang, vehicles, and character removal.
  </Accordion>

  <Accordion title="Movement" icon="move-3d">
    Noclip, bring, goto, and return teleport actions.
  </Accordion>

  <Accordion title="Reports and staff" icon="flag">
    Report viewing and management, staff chat viewing, sending, and moderation.
  </Accordion>

  <Accordion title="Operations" icon="server-cog">
    Monitoring, logs, resources, economy, items, bans, and developer tools.
  </Accordion>
</AccordionGroup>

## Wildcards

`*` grants every permission. YB Admin also understands segmented wildcards such as:

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
admin.players.*
```

Use wildcards sparingly. Individual permissions make audit and rank reviews easier.

## Protected permissions

`Config.HighLevelPermissions` prevents non-owners from granting sensitive capabilities by default:

* `*`
* `admin.groups.manage`
* `admin.resources.manage`
* `admin.players.character.remove`
* `admin.players.ban`
* `admin.bans.manage`

`Config.ProtectedGroups` prevents lower staff from editing, deleting, or assigning critical ranks such as `owner` and `superadmin`.

## Assign staff

Open **Groups** and select **Manage Staff** to:

* Search online and offline staff
* View character names, identifiers, and available profile information
* Assign a new staff member
* Change an existing rank
* Remove staff access

With `oxmysql`, assignments persist in `yb_admin_staff`.

## Duty state

Staff membership and duty are separate states.

* `isAdmin` means the player belongs to a staff group.
* `isOnDuty` means the staff member has started an active session.
* Duty is off by default when `Config.Duty.defaultOn = false`.
* Going off duty closes protected interfaces and stops active administrative modes.

<Tip>
  Use the `isOnDuty` export alongside `hasPermission` when another resource needs to authorize a staff action.
</Tip>

## ACE assignments

Assign a configured YB Admin group using a FiveM principal:

```cfg theme={"theme":{"light":"github-light","dark":"github-dark"}}
add_principal identifier.license:YOUR_LICENSE_HERE yb-admin.group.admin
```

The group name after `yb-admin.group.` must match a group configured in `editable/server.lua`.
