Permissions tutorial

Permissions tutorial

IN-GAME uhost tutorial here!!


Note: For this tutorial you will need a YAML editor (NOT notepad) such as Notetab
This tutorial is how to do it outside of game and also how to turn permissions on.
Permissions are part of bukkit that allow you give certain players access to different commands and features. A system like useful's own is required to use these permissions.

How to enable permissions

When you first try to use the permissions system (I will refer to it as uperms from here on), you may notice that it is disabled. To use it you simply have to enable it in the config. To do this find the following in your config.yml using your YAML editor:

uperms:
   enable: false

..and replace it with:

uperms:
   enable: true

You are now ready to proceed to the next step!

Setting it up and allocating groups to players

If you want to know how to do it in-game (Using uhost), then look here

Setting up the permissions (Out of game)

By default you should have a uperms.yml file in your plugin folder that looks like this:

groups:
  default:
    permissions:
      example.PermissionNode: true
  Admin:
    permissions:
      example.perm: true
    inheritance:
    - default
users:
  playerName:
    permissions:
      example.PermissionNode: true
    groups:
    - default

The users: section is where the individual player information is stored. This area is best configured in game using commands shown later.
The groups: section is where you setup the permissions for a group.

Creating a group:

In this example I am going to create a new group called Epic. This group will contain all the permissions from the group Admin and also from default.

groups:
  default:
    permissions:
      example.PermissionNode: true
  Admin:
    permissions:
      example.perm: true
    inheritance:
    - default
  Epic:
    permissions:
      epic.permission: true
    inheritance:
    - Admin
users:
  playerName:
    permissions:
      example.PermissionNode: true
    groups:
    - default

This new group is setup to now have the permission epic.permission set to true. It also has example.perm and example.permissionNode. This is accomplished using inheritance.

Inheritance

In the above example we using inheritance. What is inheritance? It is like copying the group 'inherited' from's permissions into the current one. This is the best method to do this and saves a lot of time. In the example above, any player in the Epic group will have all the permissions there as well as all from Admin and default. By default, when a player first joins, they are placed into the default group.

Giving permissions

If I would like my Admin's to be able to use /firework (node: useful.firework), I would need to give them the permission to do that. To achieve this I simply add it as a new line in their group's permissions: category set to true. So:

Admin:
    permissions:
      example.perm: true
      useful.firework: true
    inheritance:
    - default

But if I wanted an Admin to be able to do it but not Epic(They inherit their permissions)? You will need to do this:

Admin:
    permissions:
      example.perm: true
      useful.firework: true
    inheritance:
    - default
  Epic:
    permissions:
      epic.permission: true
      useful.firework: false
    inheritance:
    - Admin

By doing this Admins can do /firework but people in Epic cannot. The most important time to do this is when setting up the ranks for each group. An example could be:

Admin:
    permissions:
      example.perm: true
      useful.firework: true
      myadminrank.permission: true
    inheritance:
    - default
  Epic:
    permissions:
      epic.permission: true
      useful.firework: false
      myadminrank.permission: false
      myepicrank.permission: true
    inheritance:
    - Admin

This means that Epic will be in myepicrank, not myadminrank. This is IMPORTANT as otherwise they are in both ranks and their prefix could be either!

Important note:

Players can be in multiple permissions groups (When you assign them...) but this is UNADVISABLE because in doing this they WILL be in the rank of whichever is loaded first. Also if you have (inheritance represented by: >) default>Epic>default>Epic, etc... then it will cause server errors because it cannot inherit (directly or indirectly) from itself.

Giving players permissions

This is almost exactly the same as when allocating groups permissions. For example if I wanted playerName to have the permission useful.command then I would do this:

users:
  playerName:
    permissions:
      example.PermissionNode: true
      useful.command: true
    groups:
    - default

This will give them that node.

Allocating players to a group

This is best done ingame using uhost (Tutorial for that here)
However if you do this out of game, you simply change their groups: to the groupname. For example, putting the player storm345 (me) in the group epic(Not case sensitive) would be like so:

users:
...
storm345:
    permissions:
      useful.*: true
    groups:
    - Epic

If any of this is confusing please PM me (storm345) and tell me which part is confusing you!


Comments

Posts Quoted:
Reply
Clear All Quotes