Minecraft/Bukkit Permissions

From Multiplay Wiki

Jump to: navigation, search

NOTE: This guide is for Permissions 3, which is outdated and out of use. If you attempt to write your new files with it, they will fail and you will be a sad panda.

Admin Note: This is a guide written by Marksteele, originally posted on The Multiplay Forums

This guide is a general overview of how to use the Permissions plugin. Permissions allows for an administrator to set groups. Each group can also have their own separate permissions (Moderators can have different permissions then regular users)

Contents

Installation and Configuration

As with all Bukkit plugins, you should first add it to your list of ClanForge addons and save your profile. A restart is optional, but not needed at this stage.

You should now have a new file plugins/permissions/config.yml and can begin editing it.

Here is an example of what a working permission file looks like:

plugin:
    permissions:
        system: default
        copies: 
groups:
    Default:
        default: true
        info:
            prefix: ''
            suffix: ''
            build: true
        inheritance: 
        permissions:
            - 'essentials.help'
            - 'essentials.home'
            - 'essentials.motd'
            - 'essentials.rules'
            - 'essentials.sethome'
    Moderator:
        default: false
        info:
            prefix: '&d'
            suffix: ''
            build: true
        inheritance:
            - Default
        permissions:
            - 'essentials.tp'
            - 'essentials.tphere'
    Admins:
        default: false
        info:
            prefix: '&c'
            suffix: ''
            build: true
        inheritance:
        permissions:
            - '*'
users:
        permissions: 
    admin1:
        group: Admins
        permissions: 
    mod1:
        group: Moderator
        permissions: 
    admin2:
        group: Admins
        permissions: 
    admin3:
        group: Admins
        permissions: 
    mod2:
        group: Moderator
        permissions:

It is important that you notice how the code looks as the mod will not work properly unless it is set up like this.

Groups

Adding permissions:

To add a permission simply make a new space under the current permissions and include 12 "space" characters (press the spacebar 12 times). Please note that you can NOT use tabs as the plugin will not work.

An example of configuring groups is as follows:


groups:
    Default:
        default: true
        info:
            prefix: ''
            suffix: ''
            build: true
        inheritance: 
        permissions:
            - 'essentials.help'
            - 'essentials.home'
            - 'essentials.motd'
            - 'essentials.rules'
            - 'essentials.sethome'
            - 'example.newpermission' #This is the new line I put in for the new permission

Inheritance

There is a feature in permissions called inheritance that allows one group to have all the permissions of another group.

Heres an example:


groups:
    Default:
        default: true
        info:
            prefix: ''
            suffix: ''
            build: true
        inheritance: 
        permissions:
            - 'essentials.help'
            - 'essentials.home'
            - 'essentials.motd'
            - 'essentials.rules'
            - 'essentials.sethome'
     Example:
        default: false
        info:
            prefix: ''
            suffix: ''
            build: true
        inheritance: 
            - Default # This is an example of inheritance. 
        permissions:
            - 'essentials.tp'

In this example, the "Example" group gets all the permissions that the Default group has and in addition gets the essentials.tp permission.

Advanced: Removing a Permission

There may be a time when you want a group to inherit all the commands of another group except for certain permissions. you can do this by putting - before the permission.

Heres an example:


groups:
    Default:
        default: true
        info:
            prefix: ''
            suffix: ''
            build: true
        inheritance: 
        permissions:
            - 'essentials.help'
            - 'essentials.home'
            - 'essentials.motd'
            - 'essentials.rules'
            - 'essentials.sethome'
     Example:
        default: false
        info:
            prefix: ''
            suffix: ''
            build: true
        inheritance: 
            - Default 
        permissions:
            - '-essentials.motd' # This is an example of removing a permission

In this example the example group gets all the permissions of the default group except for the essentials.motd. That is removed by putting - before it.

Prefixes and Suffixes(Groups)

To add a chat prefix or suffix to a group you simply need to change the info section. Adding words in the prefix line will add a prefix, and adding words in the suffix line will add a suffix.

Heres an example:


    Admins:
        default: false
        info:
            prefix: 'This is a prefix'
            suffix: 'This is a suffix'
            build: true
        inheritance:
        permissions:
            - '*'

note: you may need an additional mod like iChat for this to work.

Things you need to know:

Using Wildcards

1. putting '*' as a permission gives that group all commands.

Heres an example


    Admins:
        default: false
        info:
            prefix: '&c'
            suffix: ''
            build: true
        inheritance:
        permissions:
            - '*' # This gives the admin group all usable commands

Wildcards and inheritance

2. If you use '*' do not have that group inherit any other groups Heres an example of what NOT TO DO


    Admins:
        default: false
        info:
            prefix: '&c'
            suffix: ''
            build: true
        inheritance:
            - Default
        permissions:
            - '*'

You now know everything you need to set up groups. On to users.

Users

So now you have your groups set up and looking something like this:


plugin:
    permissions:
        system: default
        copies: 
groups:
    Default:
        default: true
        info:
            prefix: ''
            suffix: ''
            build: true
        inheritance: 
        permissions:
            - 'essentials.help'
            - 'essentials.home'
            - 'essentials.motd'
            - 'essentials.rules'
            - 'essentials.sethome'
    Moderator:
        default: false
        info:
            prefix: '&d'
            suffix: ''
            build: true
        inheritance:
            - Default
        permissions:
            - 'essentials.tp'
            - 'essentials.tphere'
    Admins:
        default: false
        info:
            prefix: '&c'
            suffix: ''
            build: true
        inheritance:
        permissions:
            - '*'

Its now time to add users into their groups.

Adding a User

to add a user write the following lines and the BOTTOM of the file


users:
    yourminecraftname: # put your minecraft name here
        group: youradmingroup # put the name of your admin group here
        permissions: # leave this blank

You are now part of the admin group and can now use any permissions that you gave that group. To add more users, simply copy and paste the first one and change the minecraft name and the group.

Note: It is only necessary to add someone under users if they are not in the default group (such as an admin or moderator).

Adding permissions to users

Much like with groups, you can add permissions to users. This means that in addition to the permissions from the group, that user can also use the commands you give them here.

Here is an example:


   
     rdf:
        group: Moderator
        permissions: 
            - 'essentials.afk' # this is an example of giving a permission to a user

In this example, rdf can use all the permissions from the moderator group AND essentials.afk. No other moderator can use essentials.afk unless it was added in the same way as it was in this example.

Adding user prefixes and suffixes

Much like with a group, you can add prefixes and suffixes to usernames. To do this simply add an info section under users.

Heres an example:


    marksteele:
        group: Admins
        info:
            prefix: 'Amazing permissions guy'
            suffix: 'Godlike'
        permissions:

This would mean that whenever marksteele talked in chat it would display as Amazing permissions guymarksteeleGodlike

(rather accurate I know)

note: you may need an additional mod like iChat for this to work.

Congratulations, if your reading this message it now means you can configure and run permissions without a hitch. Now go enjoy minecraft

IMPORTANT!!! If you are having issues with your code make sure to run it though Online YAML Parser (paste your code and hit convert). Post any errors it gives you on the forum thread or the talk page along with your code using [code] tags. (If it says there are no errors then your code is fine)

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox