# Permissions:

## Permission nodes:

{% tabs %}
{% tab title="Items/Category's" %}
These permissions define whether a player is able to buy/sell items to a specific shop section, the core permissions of EconomyShopGUI.

{% hint style="info" %}
The **`<section>`** part in permssion nodes is replaced with the actual name of the shop category. This is defined by the name of the shop/section configuration.
{% endhint %}

| Permission node                       | Default | Description                                                                                            |
| ------------------------------------- | :-----: | ------------------------------------------------------------------------------------------------------ |
| EconomyShopGUI.shop.\<section>        |  `TRUE` | Gives access to buy/sell items in a **specific** shop section using the /shop GUI.                     |
| EconomyShopGUI.shop.all               |  `TRUE` | Gives permission to open **all** shop sections and buy/sell items                                      |
| EconomyShopGUI.sellall.\<section>     |  `TRUE` | Gives access to sell items in a **specific** shop section using the `/sellall inventory` command.      |
| EconomyShopGUI.sellall.all            |  `TRUE` | Allows players to sell items using the `/sellall inventory` command to **all** shop sections           |
| EconomyShopGUI.sellallitem.\<section> |  `TRUE` | This permission allows players to sell items using the `/sellall <item>` in **specific** shop sections |
| EconomyShopGUI.sellallitem.all        |  `TRUE` | Allows players to sell items to **all** shop sections using the `/sellall <item>` command              |
| EconomyShopGUI.sellallhand.\<section> |  `TRUE` | Allows players to sell in a **specific** shop section with the `/sellall hand` command                 |
| EconomyShopGUI.sellallhand.all        |  `TRUE` | Allows players to sell items using `/sellall hand` to **all** shop sections                            |
| EconomyShopGUI.sellgui.\<section>     |  `TRUE` | Allows players to sell items using the `/sellgui` command in **specific** sections                     |
| EconomyShopGUI.sellgui.all            |  `TRUE` | Allows players to sell items to **all** shop sections using `/sellgui`                                 |

Per item permissions *<mark style="color:yellow;">**\*Premium only**</mark>*

| Permission node                                          | Default | Description                                                                                             |
| -------------------------------------------------------- | :-----: | ------------------------------------------------------------------------------------------------------- |
| EconomyShopGUI.shop.\<section>.item.\<permission>        | `FALSE` | A per item permission which allows you to buy/sell this specific item in the specific shop.             |
| EconomyShopGUI.sellall.\<section>.item.\<permission>     | `FALSE` | A per item permission which allows you to buy/sell this specific item using the `/sellall` command      |
| EconomyShopGUI.sellallitem.\<section>.item.\<permission> | `FALSE` | A per item permission which allows you to buy/sell this specific item using the `/sellall item` command |
| EconomyShopGUI.sellallhand.\<section>.item.\<permission> | `FALSE` | A per item permission which allows you to buy/sell this specific item using the `/sellall hand`command  |
| EconomyShopGUI.sellgui.\<section>.item.\<permission>     | `FALSE` | em permission which allows you to buy/sell this specific item using the `/sellgui`command               |
| {% endtab %}                                             |         |                                                                                                         |

{% tab title="ShopStands" %}
Permissions for shop stands are listed here

|             Permission node             | Default |                      Description                     |
| :-------------------------------------: | :-----: | :--------------------------------------------------: |
|   EconomyShopGUI.eshop.shopstands.give  |   `OP`  |          Access to `/eshop shopstands give`          |
| EconomyShopGUI.eshop.shopstands.destroy |   `OP`  |         Access to `/eshop shopstands destroy`        |
|  EconomyShopGUI.eshop.shopstands.browse |   `OP`  |         Access to `/eshop shopstands browse`         |
|   EconomyShopGUI.eshop.shopstands.edit  |   `OP`  |      Allows to shift click a shop stand to edit      |
|  EconomyShopGUI.eshop.shopstands.create |   `OP`  | Allows to place down a shop stand item to create one |
|               {% endtab %}              |         |                                                      |

{% tab title="Other permissions" %}

| Permission node                          | Default | Description                                                                                                                                                                                       |
| ---------------------------------------- | :-----: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| EconomyShopGUI.sell-multipliers.\<group> | `FALSE` | Allows players that inhert this permission to have sell multipliers [configured inside the config.yml](https://wiki.gpplugins.com/economyshopgui/file-configuration/config.yml#sell-multipliers). |
| EconomyShopGUI.discounts.\<group>        | `FALSE` | Allows players that inhert this permission to have discounts [configured inside the config.yml](https://wiki.gpplugins.com/economyshopgui/file-configuration/config.yml#discounts-1).             |
| EconomyShopGUI.itemindexes               |   `OP`  | Allows players to see the locations of the shop items inside item lore                                                                                                                            |

GUI Editor *<mark style="color:yellow;">**\*Premium only**</mark>*

| Permission node             | Default | Description                                                            |
| --------------------------- | :-----: | ---------------------------------------------------------------------- |
| EconomyShopGUI.eshop.editor |   `OP`  | Gives access to the GUI Editor (when shift-clicking an item in a shop) |
| {% endtab %}                |         |                                                                        |

{% tab title="Commands" %}
These permissions allow players to use the different commands of EconomyShopGUI, for default all players have access to all commands except /editshop.

| Permission node                    | Default | Description                                                                   |
| ---------------------------------- | :-----: | ----------------------------------------------------------------------------- |
| EconomyShopGUI.shop                |  `TRUE` | Allows players to use the `/shop` command                                     |
| EconomyShopGUI.sellall             |  `TRUE` | Allows players to use the `/sellall` command                                  |
| EconomyShopGUI.sellallitem         |  `TRUE` | Allows a player to use the `/sellall <item>` command                          |
| EconomyShopGUI.sellallhand         |  `TRUE` | Allows a player to use the `/sellall hand` command                            |
| EconomyShopGUI.sellgui             |  `TRUE` | Allows players to use the `/sellgui` command                                  |
| EconomyShopGUI.reload              |   `OP`  | Allows players to reload the plugin with command `/sreload`                   |
| EconomyShopGUI.shopgive            |   `OP`  | Allows admins to give items to certain players or them self using `/shopgive` |
| EconomyShopGUI.eshop.\*            |   `OP`  | Allows a player to access **all** subcommands for `/editshop ...`             |
| EconomyShopGUI.eshop.additem       |   `OP`  | Allows players to use the `additem` subcommand                                |
| EconomyShopGUI.eshop.edititem      |   `OP`  | Allows players to use the `edititem` subcommand                               |
| EconomyShopGUI.eshop.deleteitem    |   `OP`  | Allows players to use the `deleteitem` subcommand                             |
| EconomyShopGUI.eshop.addhanditem   |   `OP`  | Allows players to use the `addhanditem` subcommand                            |
| EconomyShopGUI.eshop.import        |   `OP`  | Allows players to use the `import`subcommand                                  |
| EconomyShopGUI.eshop.addsection    |   `OP`  | Allows players to use the `addsection`subcommand                              |
| EconomyShopGUI.eshop.editsection   |   `OP`  | Allows players to use the `editsection`subcommand                             |
| EconomyShopGUI.eshop.deletesection |   `OP`  | Allows players to use the `deletesection`subcommand                           |
| EconomyShopGUI.eshop.uploadLayout  |   `OP`  | Allows players to use the `uploadLayout`subcommand                            |
| EconomyShopGUI.eshop.installLayout |   `OP`  | Allows players to use the `installLayout`subcommand                           |

<mark style="color:yellow;">**Premium permissions:**</mark>

| Permission node                           | Default | Description                                                                              |
| ----------------------------------------- | :-----: | ---------------------------------------------------------------------------------------- |
| EconomyShopGUI.shop.search                |  `TRUE` | Allows players to use the **/shop search** feature                                       |
| EconomyShopGUI.eshop.update               |   `OP`  | Allows players to update the plugin using **/editshop update**.                          |
| EconomyShopGUI.eshop.globalstock.\*       |   `OP`  | Gives access to all subcommands for the `/editshop globalstock` command                  |
| EconomyShopGUI.eshop.globalstock.add      |   `OP`  | Allows access to add global stock for a item                                             |
| EconomyShopGUI.eshop.globalstock.set      |   `OP`  | Allows access to set the global stock modifier for a item                                |
| EconomyShopGUI.eshop.playerstock.\*       |   `OP`  | Gives access to all subcommands for the `/editshop playerstock`command                   |
| EconomyShopGUI.eshop.playerstock.add      |   `OP`  | Allows access to add player stock for a item                                             |
| EconomyShopGUI.eshop.playerstock.set      |   `OP`  | Allows access to set the player stock modifier for a item OR all items                   |
| EconomyShopGUI.eshop.playersell.\*        |   `OP`  | Gives access to all subcommands for the `/editshop playersell`command                    |
| EconomyShopGUI.eshop.playersell.set       |   `OP`  | Allows access to set the player sell limit for a item OR all items                       |
| EconomyShopGUI.eshop.globalsell.\*        |   `OP`  | Gives access to all subcommands for the `/editshop globalsell`command                    |
| EconomyShopGUI.eshop.globalsell.set       |   `OP`  | Allows access to set the global sell limit for a item OR all items                       |
| EconomyShopGUI.eshop.dynamicpricing.\*    |   `OP`  | Gives access to all subcommands for the `/editshop dynamicpricing`command                |
| EconomyShopGUI.eshop.dynamicpricing.reset |   `OP`  | Allows you to reset the DynamicPricing for a specific item or all items at the same time |
| {% endtab %}                              |         |                                                                                          |
| {% endtabs %}                             |         |                                                                                          |

## How to setup and assign permissions: <a href="#setup-permissions" id="setup-permissions"></a>

{% hint style="info" %}
Note: Some permissions plugins are CaSe SeNsItIvE! be sure to have the right Character's upper-case or lower-case where written in the table(s) above!
{% endhint %}

### Installing a permission plugin:

Installing a permissions plugin is that easy as dragging and dropping the file inside your server plugin's folder.

1. First you need to go to your permissions plugin page. [We recommend LuckPerms](https://www.spigotmc.org/resources/luckperms.28140/), LP's `/lp editor` command and webpage is easy to use.
2. **Research how to use the permissions plugin** of your choice and be sure it is **updated and compatible** with your version of Minecraft. \[[Simple Luckperms Tutorial here](https://www.youtube.com/watch?v=Hfp5Sz3m5p4)]
3. Download the plugin.
4. Drop the file inside your plugins folder
5. Restart the server.

{% hint style="warning" %}
Note: DO NOT install multiple permissions plugins. they will all fight with each other and cause you unending headaches. :/
{% endhint %}

### Configuration:

We are not going to explain how to setup permissions in detail as everyone will want to setup their server differently. But if you [watch a video on YT](https://www.youtube.com/watch?v=Hfp5Sz3m5p4) or many others you can search for, you can learn how to setup your permissions/ranks plugin just how you want it!

See [the list of Basic permissions](#basic-permissions) you will need (above) for ESGUI after installing/setting up your permissions plugin.

## Basic permissions you will need to assign to use EconomyShopGUI: <a href="#basic-permissions" id="basic-permissions"></a>

{% hint style="danger" %}
Since version **v5.0.0** or **v4.0.0** of the plugin, all required permissions are given by default and so you will not need to assign permissions to start.
{% endhint %}

These are the permission nodes you need to add to a group or a specific player in your permissions plugin.\
\
1a. `EconomyShopGUI.shop.all` Allows access to ***all** shops* defined in the [shops.yml](https://wiki.gpplugins.com/economyshopgui/file-configuration/shops.yml) file\
-OR-\
1b. `EconomyShopGUI.shop.<section>` Allows access to *a **specific** shop* defined in the [shops.yml](https://wiki.gpplugins.com/economyshopgui/file-configuration/shops.yml) file *(Replace `<section>` with the section's name in the shops file!)*

## Permissions update:

{% hint style="danger" %}
**Please read this as updating the plugin to a newer version will cause your players not be able to sell items using /sellall and /sellgui features!**
{% endhint %}

Since version 4.4 of EconomyShopGUI and version 2.5 of EconomyShopGUI Premium we have have updated our permissions from the plugin to allow servers to have better control over which shops your players should be able to sell items to using /sellgui and /sellall.

Before players would need the **`EconomyShopGUI.shop.<section>`** or **`EconomyShopGUI.shop.all`** permission node to sell items using **`/sellall`** and **`/sellgui`** but these have been split into seperate permissions for each command.

### **How to do it?**

Basically if you don't care about which items your players can sell to shop, you will need to give your players the following permission nodes: \
➖**`EconomyShopGUI.sellall.all`** \
➖**`EconomyShopGUI.sellallitem.all`** \
➖**`EconomyShopGUI.sellallhand.all`** \
➖**`EconomyShopGUI.sellgui.all`**\
If you are using LuckPerms as your permissions plugin(recomended), this can easily be done by executing the following commands:\
➖ **`/lp group default permission set EconomyShopGUI.sellall.all true`**\
➖ **`/lp group default permission set EconomyShopGUI.sellallitem.all true`**\
➖ **`/lp group default permission set EconomyShopGUI.sellallhand.all true`**\
➖ **`/lp group default permission set EconomyShopGUI.sellgui.all true`**

On the other hand if you have a special shop which is only meant for players that have a rank on your server, you should add the shops they should have access to as seperate permission nodes.

### Added permissions since this update:

<table><thead><tr><th align="center">Permisson node:</th><th align="center">Description:</th><th data-hidden></th></tr></thead><tbody><tr><td align="center">EconomyShopGUI.sellall.&#x3C;section></td><td align="center">Gives access to sell items in a <strong>specific</strong> shop section using the <code>/sellall</code> command.</td><td></td></tr><tr><td align="center">EconomyShopGUI.sellall.all</td><td align="center">Allows players to sell items using the <code>/sellall</code> command to <strong>all</strong> shop sections</td><td></td></tr><tr><td align="center">EconomyShopGUI.sellallitem.&#x3C;section></td><td align="center">This permission allows players to sell items using the <code>/sellall item</code> in <strong>specific</strong> shop sections</td><td></td></tr><tr><td align="center">EconomyShopGUI.sellallitem.all</td><td align="center">Allows players to sell items to <strong>all</strong> shop sections using the <code>/sellall item</code> command</td><td></td></tr><tr><td align="center">EconomyShopGUI.sellallhand.&#x3C;section></td><td align="center">Allows players to sell in a <strong>specific</strong> shop section with the <code>/sellall hand</code> command</td><td></td></tr><tr><td align="center">EconomyShopGUI.sellallhand.all</td><td align="center">Allows players to sell items using <code>/sellall hand</code> to <strong>all</strong> shop sections</td><td></td></tr><tr><td align="center">EconomyShopGUI.sellgui.&#x3C;section></td><td align="center">Allows players to sell items using the <code>/sellgui</code> command in <strong>specific</strong> sections</td><td></td></tr><tr><td align="center">EconomyShopGUI.sellgui.all</td><td align="center">Allows players to sell items to <strong>all</strong> shop sections using <code>/sellgui</code></td><td></td></tr></tbody></table>

## Placeholders: <a href="#basic-permissions" id="basic-permissions"></a>

To use placeholders you will need the PlaceholderAPI plugin.\
The placeholder expansion is hard coded into the plugin itself, so it isn't requried to install any expansion from the ECloud.

### Item placeholders:

Item price placeholders are used to display buy/sell prices of shop items in placeholders.

* Buy prices: `%esgui_buyprice_<section>.<itemIndex>%`
* Sell prices: `%esgui_sellprice_<section>.<itemIndex>%`
  * \<section> is replaced with the item's section name
  * \<itemIndex> is replaced with the item's index inside the shop
    * Example: page5.items.180
  * See [how to obtain the item index](#obtaining-item-indexes-of-shop-items) here

{% hint style="info" %}
When a shop item uses dynamic prices, the plugin uses a automatic cache interval to save perfomance.\
The caching delay of dynamic prices can be specified inside the config.yml.
{% endhint %}

### Discounts / Multipliers

These placeholders return the percentage as a raw number:

* Shop discounts: `%esgui_discount_<section>%`
* Shop sell multipliers: `%esgui_sell_multiplier_<section>%`

### Shop placeholders: <a href="#shop-placeholders" id="shop-placeholders"></a>

Placeholders related to shop sections.

* %esgui\_shop\_rotation\_\<section>%
  * This placeholder returns the time left for the specified [rotating shop](https://wiki.gpplugins.com/economyshopgui/file-configuration/sections.yml#rotating-shops) to rotate

### Transaction placeholders: <a href="#transaction-placeholders" id="transaction-placeholders"></a>

Transaction placeholders are used to display the player/item which made the most amount of transactions in the shop.\
It is possible to get the top 1-10 players(or amount) purchasing/selling a single item within the current time frame.\
It is also possible to get the top 1-10 items(or amount) being purchased/sold in shop within the current time frame.

{% hint style="info" %}
Note that the free version of the plugin is limited to only the top 1-3(or amount) placeholders and marks a total of only 72 placeholder combinations which can be used.
{% endhint %}

This totals at 240 placeholder combinations which can be used!

{% hint style="success" %}
Replace **\<timeframe>** by either **MONTH, WEEK** or **DAY**
{% endhint %}

{% hint style="success" %}
Replace **\<ranking>** by **FIRST, SECOND, THIRD, FOURTH, FIFTH, SIXTH, SEVENTH, EIGTH, NINTH** or **TENTH**
{% endhint %}

#### Top player purchasing items:

* `%esgui_<ranking>_player_most_bought_items_current_<timeframe>%`
  * Player name which bought the most amount of items in the selected time frame
* `%esgui_<ranking>_player_most_bought_items_current_<timeframe>_amount%`
  * The amount of items purchased by the player at this ranking in the selected time frame

#### Top player selling items:

* `%esgui_<ranking>_player_most_sold_items_current_<timeframe>%`
  * Player name which sold the most amount of items the selected time frame
* `%esgui_<ranking>_player_most_sold_items_current_<timeframe>_amount%`
  * The amount of items sold by the player at this ranking in the selected time frame

#### Top purchased items:

* `%esgui_<ranking>_most_bought_item_current_<timeframe>%`
  * Item displayname which was purchased the most the selected time frame
* `%esgui_<ranking>_most_bought_item_current_<timeframe>_amount%`
  * The amount of the item at this ranking and selected time frame which was purchased&#x20;

#### Top sold items:

* `%esgui_<ranking>_most_sold_item_current_<timeframe>%`
  * Item displayname which was sold the most the selected time frame
* `%esgui_<ranking>_most_sold_item_current_<timeframe>_amount%`
  * The amount of the item at this ranking and the selected time frame which was sold

{% hint style="danger" %}
Note that the transaction placeholders require the option `advanced-transaction-log:` inside the config.yml to be enabled.
{% endhint %}
