Town Permissions and Permission Groups

## Overview

Town permissions allow you to configure access to individual chunks in your town. You may configure each chunk via its owner, group, or others status.

## Understanding TownChunk Permissions

### The Basics

Each town chunk has four different permission types. Build, Destroy, Interact, and Item Use. Build and Destroy allows for building and removing of blocks respectively. Interact allows switching of doors, chests, buttons, switches, etc. Item Use allows for using items like lava and water, flint and steel, etc. Each permission type has three different flags called Owner, Group, and Other. These flags can either be on or off. In addition each town chunk has both an "owner" and a "group", both of which may be "none". When a town is started or when a new plot is claimed, the town chunk's group will be set to the town's default group. (Which by default will be a group called "residents"). For each action a player performs, we determine which permission type will apply. For example, say a player places a block down, then the "build" permission type will apply. Then we check the flags for this town chunk as follows:

* If the "Others" flag is on, then we allow the action.
* If this player is the town chunk's owner, and the "Owner" flag is on, then we allow the action.
* If this player is in the group assigned to this town chunk, and the "group" flag is on, then we allow the action.
* Otherwise, we disallow this action.

### Using Groups

Each town has its own unique set of groups. Players are able to create their own groups and add and remove players to each group. Players can be in more than one group and DO NOT need to be members of town to join. By default, each town will have a "residents" group and by default, each new town chunk will be assigned to the residents group and each new town member will be added to the residents group. This group is ideal for public spaces.

#### Default Group

Each town will have a default group which new members will automatically join and new town plots will automatically have assigned to them. Players will be able to switch the default group of their town to any group of their choosing (including no group).

#### Examples

Using groups is quite powerful, here are some examples of ways you can configure groups.

##### Town Warehouse

Say you only want certain trusted members to have access to the town's public supply of materials. You can easily do this in a few steps.

* Create a new group, lets call it the "trusted" group.
* Assign each member who is trusted to the "trusted" group.
* Assign a few plots which the warehouse will reside, set the group on those plots to "trusted"

Now only members inside the "trusted" group will have access to the town warehouse.

##### Embassy Plots

Since group members do not need to be town members, you can use groups to create embassy plots.

* Create a new group, lets call it "PotatoNation"
* Assign members from the potato nation to the "PotatoNation" group.
* Assign a few plots which will be the embassy to the "PotatoNation".

Note: In the future, groups may have leaders which will allow them to self-manage their own group. Also, you will be able to sell/charge rent for embassy plots using another mechanism. TBD.

### Town Chunk Ownership

Being a member of a group assigned to a plot and being the plot's owner is slightly different. When you are the plot's owner, you have control over which group is assigned to the chunk, and which permission flags are enabled on which types. If the plot has no owner, the town's staff is treated as the owner.

### Simple steps to giving permissions

Lets say you want to give Steve access to the plot that he built his house on and you don't want anyone else to mess with it. For this example we are going to say that the plot is currently unclaimed and the name of the group will be StevesPlot

* Step 1 Claim the plot(s) - Stand in chunk(s) and do /t claim

```
       This will cost your town money depending on how many plots it currently has claimed. (Must be done in each chunk)

```

* Step 2 Clear all current groups from plot(s) - Still standing in chuck do /plot cleargroups

```
       This will remove all groups from claimed plot including mayors and residents.

```

* Step 3 Create new group in Town - Standing anywhere do /t group new StevesPlot

```
       This will create a town group with the name of StevesPlot

```

* Step 4 Add Steve to the new group - Standing anywhere do /t group add Steve StevesPlot

```
       This command added player Steve to group StevesPlot

```

* Step 5 Define the plots that StevesPlot group will have access to - Standing in chunk(s) do /plot addgroup StevesPlot

```
       This command adds the group to the plot. Note this has to be done to each plot you want the group on.

```

Congrats you have successfully created a new group and defined what plot(s) this group has access to.