Search in sources :

Example 1 with Permission

use of org.bukkit.permissions.Permission in project Bukkit by Bukkit.

the class PluginManagerTest method testRemovePermissionByName.

private void testRemovePermissionByName(final String name) {
    final Permission perm = new Permission(name);
    pm.addPermission(perm);
    assertThat("Permission \"" + name + "\" was not added", pm.getPermission(name), is(perm));
    pm.removePermission(name);
    assertThat("Permission \"" + name + "\" was not removed", pm.getPermission(name), is(nullValue()));
}
Also used : Permission(org.bukkit.permissions.Permission)

Example 2 with Permission

use of org.bukkit.permissions.Permission in project Bukkit by Bukkit.

the class BroadcastPermissions method registerPermissions.

public static Permission registerPermissions(Permission parent) {
    Permission broadcasts = DefaultPermissions.registerPermission(ROOT, "Allows the user to receive all broadcast messages", parent);
    DefaultPermissions.registerPermission(PREFIX + "admin", "Allows the user to receive administrative broadcasts", PermissionDefault.OP, broadcasts);
    DefaultPermissions.registerPermission(PREFIX + "user", "Allows the user to receive user broadcasts", PermissionDefault.TRUE, broadcasts);
    broadcasts.recalculatePermissibles();
    return broadcasts;
}
Also used : Permission(org.bukkit.permissions.Permission)

Example 3 with Permission

use of org.bukkit.permissions.Permission in project Bukkit by Bukkit.

the class CommandPermissions method registerBan.

private static Permission registerBan(Permission parent) {
    Permission ban = DefaultPermissions.registerPermission(PREFIX + "ban", "Allows the user to ban people", PermissionDefault.OP, parent);
    DefaultPermissions.registerPermission(PREFIX + "ban.player", "Allows the user to ban players", ban);
    DefaultPermissions.registerPermission(PREFIX + "ban.ip", "Allows the user to ban IP addresses", ban);
    ban.recalculatePermissibles();
    return ban;
}
Also used : Permission(org.bukkit.permissions.Permission)

Example 4 with Permission

use of org.bukkit.permissions.Permission in project Bukkit by Bukkit.

the class CommandPermissions method registerTime.

private static Permission registerTime(Permission parent) {
    Permission time = DefaultPermissions.registerPermission(PREFIX + "time", "Allows the user to alter the time", PermissionDefault.OP, parent);
    DefaultPermissions.registerPermission(PREFIX + "time.add", "Allows the user to fast-forward time", time);
    DefaultPermissions.registerPermission(PREFIX + "time.set", "Allows the user to change the time", time);
    time.recalculatePermissibles();
    return time;
}
Also used : Permission(org.bukkit.permissions.Permission)

Example 5 with Permission

use of org.bukkit.permissions.Permission in project Bukkit by Bukkit.

the class CommandPermissions method registerPermissions.

public static Permission registerPermissions(Permission parent) {
    Permission commands = DefaultPermissions.registerPermission(ROOT, "Gives the user the ability to use all CraftBukkit commands", parent);
    registerWhitelist(commands);
    registerBan(commands);
    registerUnban(commands);
    registerOp(commands);
    registerSave(commands);
    registerTime(commands);
    DefaultPermissions.registerPermission(PREFIX + "kill", "Allows the user to commit suicide", PermissionDefault.TRUE, commands);
    DefaultPermissions.registerPermission(PREFIX + "me", "Allows the user to perform a chat action", PermissionDefault.TRUE, commands);
    DefaultPermissions.registerPermission(PREFIX + "tell", "Allows the user to privately message another player", PermissionDefault.TRUE, commands);
    DefaultPermissions.registerPermission(PREFIX + "say", "Allows the user to talk as the console", PermissionDefault.OP, commands);
    DefaultPermissions.registerPermission(PREFIX + "give", "Allows the user to give items to players", PermissionDefault.OP, commands);
    DefaultPermissions.registerPermission(PREFIX + "teleport", "Allows the user to teleport players", PermissionDefault.OP, commands);
    DefaultPermissions.registerPermission(PREFIX + "kick", "Allows the user to kick players", PermissionDefault.OP, commands);
    DefaultPermissions.registerPermission(PREFIX + "stop", "Allows the user to stop the server", PermissionDefault.OP, commands);
    DefaultPermissions.registerPermission(PREFIX + "list", "Allows the user to list all online players", PermissionDefault.OP, commands);
    DefaultPermissions.registerPermission(PREFIX + "help", "Allows the user to view the vanilla help menu", PermissionDefault.TRUE, commands);
    DefaultPermissions.registerPermission(PREFIX + "plugins", "Allows the user to view the list of plugins running on this server", PermissionDefault.TRUE, commands);
    DefaultPermissions.registerPermission(PREFIX + "reload", "Allows the user to reload the server settings", PermissionDefault.OP, commands);
    DefaultPermissions.registerPermission(PREFIX + "version", "Allows the user to view the version of the server", PermissionDefault.TRUE, commands);
    DefaultPermissions.registerPermission(PREFIX + "gamemode", "Allows the user to change the gamemode of another player", PermissionDefault.OP, commands);
    DefaultPermissions.registerPermission(PREFIX + "xp", "Allows the user to give themselves or others arbitrary values of experience", PermissionDefault.OP, commands);
    DefaultPermissions.registerPermission(PREFIX + "toggledownfall", "Allows the user to toggle rain on/off for a given world", PermissionDefault.OP, commands);
    DefaultPermissions.registerPermission(PREFIX + "defaultgamemode", "Allows the user to change the default gamemode of the server", PermissionDefault.OP, commands);
    DefaultPermissions.registerPermission(PREFIX + "seed", "Allows the user to view the seed of the world", PermissionDefault.OP, commands);
    DefaultPermissions.registerPermission(PREFIX + "effect", "Allows the user to add/remove effects on players", PermissionDefault.OP, commands);
    commands.recalculatePermissibles();
    return commands;
}
Also used : Permission(org.bukkit.permissions.Permission)

Aggregations

Permission (org.bukkit.permissions.Permission)20 ConfigurationNode (com.bergerkiller.bukkit.common.config.ConfigurationNode)1 IPermissionDefault (com.bergerkiller.bukkit.common.permissions.IPermissionDefault)1 Job (com.gamingmesh.jobs.container.Job)1 JobPermission (com.gamingmesh.jobs.container.JobPermission)1 JobProgression (com.gamingmesh.jobs.container.JobProgression)1 JobsPlayer (com.gamingmesh.jobs.container.JobsPlayer)1 HashMap (java.util.HashMap)1 World (org.bukkit.World)1 ConfigurationSection (org.bukkit.configuration.ConfigurationSection)1 MemorySection (org.bukkit.configuration.MemorySection)1 Player (org.bukkit.entity.Player)1 EventHandler (org.bukkit.event.EventHandler)1 HelpMap (org.bukkit.help.HelpMap)1 PermissionAttachment (org.bukkit.permissions.PermissionAttachment)1 PermissionAttachmentInfo (org.bukkit.permissions.PermissionAttachmentInfo)1 PermissionDefault (org.bukkit.permissions.PermissionDefault)1 PluginManager (org.bukkit.plugin.PluginManager)1