Step 6: Permissions
What is pEX?
pEX is a mod called PermissionsEX and is one of the most used permission mods available for free. Just about every mod I've ever tried works with it in some way and its pretty straight forward in how it manages Users, Groups, and Worlds. Its debug function is also great when using multiple mods and trying to figure out why a user can't place a block, activate a switch, or open a chest. While I can't give you a perfect configuration for your server, I can give you an idea of how I managed this last group of students through out the year and allowed for me to move them to other towns and groups quickly and easily.
To install pEX, get the file following the link in The Mods page and put it into your plugins folder and restart the server. If you want to use SQL you would now stop the server, and edit the config file in the PermissionsEX plugin folder to match the settings in your SQL server.
To install pEX, get the file following the link in The Mods page and put it into your plugins folder and restart the server. If you want to use SQL you would now stop the server, and edit the config file in the PermissionsEX plugin folder to match the settings in your SQL server.
pEX SQL config
Setting up the admin user
By default, even users that have been given OP, don't have full control over pEX and can not do any editing in game. To allow this you'll need to issue the following command in the server console for each user you want to have the ability to edit pEX permissions.
Pex Admin User Command
The * symbol is called an Asterix and can be made by holding Shift and pressing the number 8 button. * in most computer languages is a wild-card, and means Everything and Anything. So we are telling plex that the user and every permission possible. This can also work in reverse, if you ass a negative symbol "-" in front of the permission like "-*", you can see what happens if a user doesn't have any permissions.
Adding permissions for a user
When adding permissions for users in pEX you'll need to check the webpage for each mod to see what permissions it has and allows you to change. In general most permissions are setup to be either Allow or Disallow a single action and follow a structure like (modname).(action/item).(subaction/subitem) as you can see in the example below.
Craftconomy User Permissions Example
So in the example above we are allowing a user to do a few basic things for the Craftconomy mod to work for them. We are allowing them to check their balance, to pay for things, to read the help messages, and create is the permission to allow a user to create a new bank account. One permissions missing that you might add is to allow users to give money to other players. I didn't allow this to prevent students from using some students computer while they were in the restroom or distracted and stealing their money.
Creating and adding permissions for a group
Groups allow us to make things much easier for us to handle a large group of users. You can assign all the permissions you want for a user in a group, and then every time a new person joins you just add them to that group, instead of typing out a hundred permissions commands. I would encourage you to never set any permissions on a user level if possible, instead create groups and put all the permissions in there that you want people to have. A user can have multiple groups assigned to them, and groups themselves can be ordered into groups, but that is all much more complicated than what I did last year which was mostly creating a single base group, and then a separate group for each team so I could prevent non-team members from going to a teams town and causing trouble.
The below example shows how to make a new group, add some permissions to it, and then set it as the base group for the user.
The below example shows how to make a new group, add some permissions to it, and then set it as the base group for the user.
Group Permissions Example
Now that you have the basics down, Lets think about what we need for our server. The default group should have no permissions assigned to it, so that any user that joins the server is severely limited in what they can do and prevents problems if your server is available over the internet. Next we should have the base group for all players, with all the permissions that every player needs to interact with your world, so money, shopping, teleports to main areas, etc. On top of that we should create groups for each team of students, so that you can set special teleport locations for each team if you wish to keep them separated, or award them something special.
Setting up group inheritence is very easy thankfully, and if you need to make more and more groups it is really just a matter of adjusting which groups are inherited. Lets create a new group for Team A that inherits our BaseGroup and allows the group to make chestregen chest.
Setting up group inheritence is very easy thankfully, and if you need to make more and more groups it is really just a matter of adjusting which groups are inherited. Lets create a new group for Team A that inherits our BaseGroup and allows the group to make chestregen chest.
Team A group setup
Now before you move your player to the new group, have them try and make a chestregen chest. They shouldn't be able too, if so make sure they don't also have the * permission set for them. If they can't, set their group to TeamA and try again, they should now be able to make a perplayer chest like we did in the previous episode, and destroy it. They should also be able to still use all the Money commands.
Before we finish, lets remove all the chestregen commands from TeamA as its pretty game breaking to let users regen any items they want constantly. So we will have three groups, Default (no permissions), Basegroup (money permissions), and TeamA (no permissions, but inheriting from Basegroup). With that we can move onto creating our first Shops so we can make use of our money.
Before we finish, lets remove all the chestregen commands from TeamA as its pretty game breaking to let users regen any items they want constantly. So we will have three groups, Default (no permissions), Basegroup (money permissions), and TeamA (no permissions, but inheriting from Basegroup). With that we can move onto creating our first Shops so we can make use of our money.