Location permissions - PneumatiCraft/OpenWarp GitHub Wiki

It's all well and good that OpenWarp lets players make "public" or "private" warps, but what about a warp that's in between? Maybe half the players on a server should be allowed to go to a certain warp, but the other half don't have that privilege. How does OpenWarp handle these situations? The answer lies in location permissions.

Location permissions are OpenWarp's way of restricting access to warps that would otherwise be public. Admins can assign or remove location permissions on a per-warp or per-home basis, and these permissions allow (or disallow) certain users access to those locations.

Nodes

Location permissions operate on two categories of location: warps and homes. The permission nodes are as follows:

  • Public warps: openwarp.warp.access.public.WARP
  • Private warps: openwarp.warp.access.private.PLAYER.WARP
  • Homes: openwarp.home.access.PLAYER

All the relevant wildcard (*) nodes are in place as well, so admins can assign openwarp.warp.access.public.*: true to one player, but set the specific permission openwarp.warp.access.public.mywarp: false to another.

The check procedure

One of the important things to know when using location permissions is how they affect users' warp and home access. These changes are different for warps and homes.

Warps

By default, every user has access to every warp. In other words, all users have the openwarp.warp.access.* permission.

This doesn't mean that users can warp anywhere. Having access to a warp and being able to find that warp are two different things. When looking up a warp, OpenWarp takes the following steps:

  1. It searches public warps for the specified name. If it's found, it skips to step 3.
  2. It searches the player's private warps for the specified name. If no warp is found here, it stops.
  3. Once it's found a warp, OpenWarp checks the relevant openwarp.warp.access... permission. If the permission is true, the user warps; otherwise, the user sees a permission error message.

Take a closer look at step 2: OpenWarp will only search the player's private warps for the requested name. With two players, Alice and Bob, we can set up a situation where Bob has access permission to all of Alice's private warps, but he will still never get there - since OpenWarp will not search Alice's private warps to teleport Bob anywhere.

Because of this, warp access permissions are usually used to deny certain players access to public warps. Admins can remove openwarp.warp.access.public.mywarp from Bob, and even though /warp mywarp will still find the warp, Bob will be denied the teleport, because he doesn't have the access permission.

Homes

Homes work a little differently, and there is one golden rule governing home access: Every player can always access their own home. Denying a player access to their own home will have no effect.

Because of this, home access nodes are usually used to allow players access to each other's homes. Ops have the permission openwarp.home.access.* by default; everybody else can only access their own home.

If, for example, Bob grants Alice the openwarp.home.access.Bob node, then Alice can run /home Bob and move to Bob's home. Home access is not a two-way street, however: even though Alice can get to Bob's home, Bob can't necessarily get to Alice's.