# 🔒 Permissions

## Reroll Permissions

All permissions related to the reroll feature.

**Reroll Permissions**

| Permission                       | Description                                       |
| -------------------------------- | ------------------------------------------------- |
| phoenixcrates.command.givereroll | Allow user to give a specified amount of rerolls. |
| phoenixcrates.command.takereroll | Allow user to take a specified amount of rerolls. |
| phoenixcrates.reroll.\<group>    | Grants the rerolls of a [reroll group](../features/reroll.md#group-permissions). |

`<group>` is the name of the group as typed in the editor. Groups do not stack, only the highest matching one applies.

## Key Permissions

**Key Permissions**

| Permission                    | Description                                          |
| ----------------------------- | ---------------------------------------------------- |
| phoenixcrates.command.givekey | Allow user to give a key                      |
| phoenixcrates.command.givekeyall | Allow user to give a key to everyone                      |
| phoenixcrates.command.takekey | Allow user to take a key.                      |
| phoenixcrates.command.setkey  | Allow user to set a specific number of virtual keys. |
| phoenixcrates.command.resetkeyall | Allow user to reset a specific virtual key for all players. |

## General Permissions

**General Permissions**

| Permission                          | Description                                                    |
| ------------------------------------ | --------------------------------------------------------------- |
| phoenixcrates.admin                 | Grants access to everything regarding the plugin.              |
| phoenixcrates.*                     | Grants all PhoenixCrates permissions (includes phoenixcrates.admin). |
| phoenixcrates.command.create        | Allows user to create a crate.                                  |
| phoenixcrates.command.delete        | Allows user to delete a crate.                                  |
| phoenixcrates.command.edit          | Allow user to open the in-game editor for a specific crate or key. |
| phoenixcrates.command.givecrate     | Allows user to give a crate.                                    |
| phoenixcrates.command.givecrateall  | Allows user to give a crate to everyone.                        |
| phoenixcrates.command.givereward    | Allow user to give a specified reward.                          |
| phoenixcrates.command.preview       | Allow user to use the preview command.                          |
| phoenixcrates.command.editor        | Allow user to access the ingame editor and the menu layout editor. |
| phoenixcrates.command.reload        | Allow user to reload the plugin.                                |
| phoenixcrates.command.setlanguage   | Allow user to switch the plugin language.                       |
| phoenixcrates.command.migrate       | Allow user to import data from another crate plugin.            |
| phoenixcrates.command.addons        | Allow user to list the available and installed add-ons.         |
| phoenixcrates.command.changelog     | Allow user to open the changelog of released builds.            |
| phoenixcrates.command.open          | Allow user to open a crate directly with the open command.     |
| phoenixcrates.command.resetcooldown | Allow user to reset a player's crate cooldown.                  |
| phoenixcrates.command.giverandomreward | Allow user to give a random reward from a crate.              |
| phoenixcrates.command.checkkeys     | Allow user to check another player's virtual keys.              |
| phoenixcrates.command.resetglobalwinlimit | Allow user to reset the global win count of a reward.     |
| phoenixcrates.command.resetplayerwinlimit | Allow user to reset a player's win count for a reward.    |
| phoenixcrates.command.resetplayerwinlimitcooldown | Allow user to reset a player's win limit cooldown for a reward. |
| phoenixcrates.command.resetglobalwinlimitcooldown | Allow user to reset the global win limit cooldown of a reward. |
| phoenixcrates.command.restartcooldowns | Allow user to restart the cooldowns for a reward.           |
| phoenixcrates.command.setglobalwinlimit | Allow user to set the global win count of a reward.        |
| phoenixcrates.command.setplayerwinlimit | Allow user to set a player's win count for a reward.       |
| phoenixcrates.command.resetopenings | Allow user to reset crate openings of a player or everyone.     |
| phoenixcrates.command.setopenings   | Allow user to set a player's crate openings.                    |
| phoenixcrates.command.summon        | Allow user to summon a crate, key, or reward item at a location. |
| phoenixcrates.command.attach        | Allow user to attach a crate to the block they are looking at.  |
| phoenixcrates.command.detach        | Allow user to detach a crate from the block they are looking at. |
| phoenixcrates.command.place         | Allow user to place or remove a crate at a specific world location. |
| phoenixcrates.command.testopen      | Allow user to test the opening of a crate.                      |
| phoenixcrates.command.simulate      | Allow user to simulate the odds of a crate.                     |
| phoenixcrates.command.brokenrewards | Allow user to list the broken rewards.                          |
| phoenixcrates.command.backup        | Allow user to save a backup of the plugin files.                |
| phoenixcrates.command.doctor        | Allow user to run the health check.                             |
| phoenixcrates.command.dashboard     | Allow user to check the web dashboard status and link the server. |

## Crate Permissions

Each crate can be configured to require its own permission before a player is allowed to interact with it. By default, this is `phoenixcrates.crate.<id>`, but it can be customized per crate in the crate configuration file under `permission.permission`, and toggled on/off with `permission.required`.

**Crate Permissions**

| Permission                | Description                                                  |
| -------------------------- | ------------------------------------------------------------- |
| phoenixcrates.crate.\<id> | Allows the player to interact with the crate matching `<id>`. |

## Placing and Removing Crates

The command permissions above cover the commands. Doing the same thing by hand in the world is gated on phoenixcrates.admin instead:

* Placing a crate item into the world.
* Shift + left-clicking a placed crate to remove it.

So a builder given `phoenixcrates.command.place` can still only place crates through the command. To let them place crates by hand they need `phoenixcrates.admin`, which grants everything else too.

Source: https://www.phoenixplugins.com/docs/phoenix-crates/plugin-information/permissions