Permission Attachment
Permission attachments allow players to have temporary access to command permissions. It's only available via player delegate to prevent a vulnerability when it's used as a prompt queue argument.
How to use Permission Attachment
The general idea is to give players a set of permissions that you define in a very short amount of time. This permission set and the duration can be found and configured in config.yml under the Permission Attachment section.
Step 1: Configuring permissions
# Permission Attachment Config
# 
# Permission attachments allow players
# to have temporary permissions.
# 
# ticks - Set how long (in ticks) should the
#         permission attachment persist.
# 
# permissions - permissions to temporarily
#               attach to the players.
Permission-Attachment:
  ticks: 1
  Permissions:
    GAMEMODE:
    - bukkit.command.gamemode
    - essentials.gamemode
    - essentials.gamemode.survival
    - essentials.gamemode.creative
    With the given configuration above, we defined a permission attachment called GAMEMODE to attach gamemode-related permission.
It's important that you only give permissions that you are willing to give to your players. I advise against putting permissions that allow your server to be compromised!
Step 2: Using permission attachments in a prompt
To use the permission attachment, we need to use it via the Player Delegate like the following:
playerdelegate CyR1en GAMEMODE gamemode <what gamemode do you want?>Once the player fulfilled the prompt, CommandPrompter will attach the permissions defined under GAMEMODE and dispatch the command, and remove the attached permissions afterward.
Last updated
Was this helpful?