Skip to content

Permissions

grandwazir edited this page Dec 19, 2011 · 16 revisions

Setting up permissions

Permission nodes for commands

Each command is assigned its own permission node and all follow the same style. The full list is below:

jchat.refresh
jchat.refresh.others
jchat.reload

Operators receive all these permissions by default, while users will get the ability to refresh their own name by default.

Permission nodes for prefixes

The permission nodes for jChat change depending on what you have in your configuration file. For this example I am going to assume you have not changed your configuration file beyond what is created when you first load the plugin, which looks like this:

prefix:
   default: '&DARK_BLUE'
suffix:
   default: ''

The default prefix and suffix is automatically assigned to all players. If you do not want to give them anything special either override this in permissions.yml or leave both of them blank. Let's say I now add a prefix for my operators.

prefix:
   admin: '&RED'
   default: '&DARK_BLUE'
suffix:
   default: ''

Note I moved default so it is at the bottom of my list. This is so if I also have the default permission node, jChat will give me the prefix I am expecting. More on this in a minute. Now I would need to assign all my administrators the following permission node.

jchat.prefix.admin

Be careful when assigning multiple prefixes/suffixes to one player

jChat checks the permissions from the top of the list working down until it finds a prefix the player has. It will then use that prefix and go looking for a suffix in the same way.

If you are assigning permissions using the built in system make sure when inheriting from another group that you set the old prefix to false. You will need to do a similar thing for other permission managers.

Alternatively, if you can not be bothered with that, you can order the prefixes in the config.yml in the order that you want the plugin to check. By doing this you can avoid deducting permissions entirely, but might get confusing to setup if you have lots of groups inheriting from each other.

Example configurations

One of the new features with the built in permissions system is that it is now possible to group permissions together into one node then assign that to groups and users. This is really very useful in keeping all your permissions organised.

I have included an example below that shows how I use groups to assign the default prefix to new players that join my server. The first example you need to add to your permissions.yml file and then assign them using a Permission manager that is aware of the built in system.

Assigning a prefix to everyone

server.basics:
  description: Permission nodes that everyone gets.
  default: true
  children:
    jchat.prefix.guest: true