# Permissions

# Shop Permissions

These are the permissions of **Core's NPC shops**. The player shop mod has its own nodes (`ks.shop.user.*`, `ks.shop.admin`, rentals) — see [Player Shops Permissions](https://wiki.kyuubisoft.com/hytale/player-shops/permissions/).

## Permission Nodes

| Permission | Default | Description |
|---|---|---|
| `ks.core.shop.user.use` | not set | `/ksnpcshop open`, `sell` and `list`. When you set it (allow or deny), it decides. |
| `ks.shop.user.use` | ✅ allowed | The old node, shared with the Player Shops mod. It only decides while `ks.core.shop.user.use` is not set. |
| `ks.admin` | ❌ staff only | Opens the shop editor from the `/ksadmin` hub and is checked again on every save. |
| `ks.core.admin.dialog.console` | ❌ staff only | Needed in the shop editor for everything that touches entries that run as the console (see below). |

:::tip
To block the NPC shop commands for a group without touching the Player Shops mod, deny `ks.core.shop.user.use` for that group. To allow them again, set it to `true` or remove it.
:::

Opening a shop at its NPC does not use these command nodes. The shop's own `permission` field and the `openVia` setting decide there.

## Shop and Entry Permissions (config-driven)

A shop and each of its entries can require a permission of your choice:

```json
{
  "id": "vip_market",
  "permission": "shop.vip",
  "items": [
    {
      "itemId": "Weapon_Sword_Adamantite",
      "cost": 50,
      "permission": "shop.vip.weapons"
    }
  ]
}
```

| Field | Where | Effect |
|---|---|---|
| `permission` | shop | Players without it get "You don't have permission to access this shop." and the shop does not open. |
| `permission` | entry | The entry is shown as locked and cannot be bought without it. |

The mod checks whatever string you set — the `shop.` prefix is only a convention. Leave the field empty (or `null`) for no restriction.

## Shop Editor and Console Commands

Shop entries with a `command` can run as the **console** (`"commandRunAsServer": true`) or as the **buyer**. Console commands run with full server rights, so the shop editor protects them:

- Adding, changing or removing an entry that runs as the console needs `ks.core.admin.dialog.console`.
- So does changing who may trigger it: the permission of such an entry, and the shop's permission while the shop has such entries.
- Copying, duplicating or deleting a shop that has console entries needs it too.
- Without the node these fields are read-only with a note, new command entries run as the buyer, and the save is checked again on the server. Prices, names and limits stay editable.
- Web editor imports follow the same rule: without the node, existing console entries stay as they are and the import result names them.

Existing console entries keep working for players either way.

## LuckPerms Examples

```bash
# Shop staff: edit NPC shops in the /ksadmin hub
/lp group shopstaff permission set ks.admin true

# Only the owner may create or change console command entries
/lp group owner permission set ks.core.admin.dialog.console true

# Block the /ksnpcshop commands for guests (NPCs still open their shops)
/lp group guest permission set ks.core.shop.user.use false

# VIP shop
/lp group vip permission set shop.vip true
```

:::warning
`ks.core.admin.dialog.console` lets staff create commands that run with full server rights — in shops, NPCs and dialogs. Give it only to people you would also give console access.
:::