Permissions

Included with OpenCraft is this example permissions file:

VERSION 1

// Example permissions

ROLE Player {
    org.opencraft.server.cmd.impl.TeleportCommand.execute
    org.opencraft.server.cmd.impl.GotoCommand.execute
    org.opencraft.server.cmd.impl.HelpCommand.execute
    org.opencraft.server.cmd.impl.SpawnCommand.execute
    org.opencraft.server.cmd.impl.MeCommand.execute
    org.opencraft.server.cmd.impl.LevelsCommand.execute
    org.opencraft.server.cmd.impl.PingCommand.execute
    org.opencraft.server.cmd.impl.RollCommand.execute
}

ROLE Builder {
    @Player
    org.opencraft.server.Build
    org.opencraft.server.Destroy
}

ROLE Op {
    @Builder
    org.opencraft.server.cmd.impl.KickCommand.execute
    org.opencraft.server.cmd.impl.SummonCommand.execute
    org.opencraft.server.cmd.impl.SayCommand.execute
    org.opencraft.server.cmd.impl.SetspawnCommand.execute
}

GROUP admins {
    //Add your administrators here
}

GROUP operators {
    //Add your operators here
}

GROUP builders {
    //Add your builders here
}

//Grants the Player role to all players
ALLOW @Player to @ALL

//Gives admins everything
ALLOW * to @admins
ALLOW @Builder to @builders
ALLOW @Op to @operators

//Let everyone build on the default world
WORLD default {
    ALLOW @Builder to @ALL
}

In OpenCraft security, there are five types of 'blocks':

  • VERSION
  • ROLE
  • GROUP
  • ALLOW
  • WORLD

The VERSION block is not required, but if present it must be the first line of the file. The current permission syntax is version 1.

ROLE blocks give names to collections of permissions.

GROUP blocks do the same, but for users.

ALLOW blocks associate permissions or roles with individual users or groups.

WORLD blocks limit the scope of everything to a specific world in the server.

Be careful, the file is case sensitive.