Permission node simplification.

This commit is contained in:
Olof Larsson 2014-04-03 17:21:07 +02:00
parent 1bb7d0a1d5
commit 722ce6b2a7
26 changed files with 108 additions and 109 deletions

View File

@ -10,29 +10,29 @@ permissions:
# THE REAL NODES
# -------------------------------------------- #
# cmd
mcore.cmd.mcore: {description: use the mcore command, default: false}
mcore.cmd.mcore.id: {description: see the server id, default: false}
mcore.cmd.mcore.version: {description: diplay plugin version, default: false}
mcore.cmd.mcore.hearsound: {description: hear a sound, default: false}
mcore.cmd.mcore.mstore: {description: use the mstore command, default: false}
mcore.cmd.mcore.mstore.stats: {description: show mstore statistics, default: false}
mcore.cmd.mcore.mstore.listcolls: {description: list collections in a database, default: false}
mcore.cmd.mcore.mstore.copydb: {description: copy database content, default: false}
mcore.cmd.mcore.usys: {description: use the usys command, default: false}
mcore.cmd.mcore.usys.multiverse: {description: manage multiverses, default: false}
mcore.cmd.mcore.usys.multiverse.list: {description: list multiverses, default: false}
mcore.cmd.mcore.usys.multiverse.show: {description: show multiverse, default: false}
mcore.cmd.mcore.usys.multiverse.new: {description: create new multiverse, default: false}
mcore.cmd.mcore.usys.multiverse.del: {description: delete multiverse, default: false}
mcore.cmd.mcore.usys.universe: {description: manage universes, default: false}
mcore.cmd.mcore.usys.universe.new: {description: create new universe in multiverse, default: false}
mcore.cmd.mcore.usys.universe.del: {description: delete universe in multiverse, default: false}
mcore.cmd.mcore.usys.universe.clear: {description: clear universe in multiverse, default: false}
mcore.cmd.mcore.usys.world: {description: set a worlds universe in a multiverse, default: false}
mcore.cmd.mcore.usys.aspect: {description: manage aspects, default: false}
mcore.cmd.mcore.usys.aspect.list: {description: list aspects, default: false}
mcore.cmd.mcore.usys.aspect.show: {description: show aspect, default: false}
mcore.cmd.mcore.usys.aspect.use: {description: set multiverse for aspect, default: false}
mcore.basecommand: {description: use the MCore base command, default: false}
mcore.id: {description: see the server id, default: false}
mcore.version: {description: diplay plugin version, default: false}
mcore.hearsound: {description: hear a sound, default: false}
mcore.mstore: {description: use the mstore command, default: false}
mcore.mstore.stats: {description: show mstore statistics, default: false}
mcore.mstore.listcolls: {description: list collections in a database, default: false}
mcore.mstore.copydb: {description: copy database content, default: false}
mcore.usys: {description: use the usys command, default: false}
mcore.usys.multiverse: {description: manage multiverses, default: false}
mcore.usys.multiverse.list: {description: list multiverses, default: false}
mcore.usys.multiverse.show: {description: show multiverse, default: false}
mcore.usys.multiverse.new: {description: create new multiverse, default: false}
mcore.usys.multiverse.del: {description: delete multiverse, default: false}
mcore.usys.universe: {description: manage universes, default: false}
mcore.usys.universe.new: {description: create new universe in multiverse, default: false}
mcore.usys.universe.del: {description: delete universe in multiverse, default: false}
mcore.usys.universe.clear: {description: clear universe in multiverse, default: false}
mcore.usys.world: {description: set a worlds universe in a multiverse, default: false}
mcore.usys.aspect: {description: manage aspects, default: false}
mcore.usys.aspect.list: {description: list aspects, default: false}
mcore.usys.aspect.show: {description: show aspect, default: false}
mcore.usys.aspect.use: {description: set multiverse for aspect, default: false}
# misc
mcore.notpdelay: {description: teleport without delay, default: false}
# -------------------------------------------- #
@ -41,29 +41,29 @@ permissions:
mcore.*:
default: false
children:
mcore.cmd.mcore: true
mcore.cmd.mcore.id: true
mcore.cmd.mcore.version: true
mcore.cmd.mcore.hearsound: true
mcore.cmd.mcore.mstore: true
mcore.cmd.mcore.mstore.stats: true
mcore.cmd.mcore.mstore.listcolls: true
mcore.cmd.mcore.mstore.copydb: true
mcore.cmd.mcore.usys: true
mcore.cmd.mcore.usys.multiverse: true
mcore.cmd.mcore.usys.multiverse.list: true
mcore.cmd.mcore.usys.multiverse.show: true
mcore.cmd.mcore.usys.multiverse.new: true
mcore.cmd.mcore.usys.multiverse.del: true
mcore.cmd.mcore.usys.universe: true
mcore.cmd.mcore.usys.universe.new: true
mcore.cmd.mcore.usys.universe.del: true
mcore.cmd.mcore.usys.universe.clear: true
mcore.cmd.mcore.usys.world: true
mcore.cmd.mcore.usys.aspect: true
mcore.cmd.mcore.usys.aspect.list: true
mcore.cmd.mcore.usys.aspect.show: true
mcore.cmd.mcore.usys.aspect.use: true
mcore.basecommand: true
mcore.id: true
mcore.version: true
mcore.hearsound: true
mcore.mstore: true
mcore.mstore.stats: true
mcore.mstore.listcolls: true
mcore.mstore.copydb: true
mcore.usys: true
mcore.usys.multiverse: true
mcore.usys.multiverse.list: true
mcore.usys.multiverse.show: true
mcore.usys.multiverse.new: true
mcore.usys.multiverse.del: true
mcore.usys.universe: true
mcore.usys.universe.new: true
mcore.usys.universe.del: true
mcore.usys.universe.clear: true
mcore.usys.world: true
mcore.usys.aspect: true
mcore.usys.aspect.list: true
mcore.usys.aspect.show: true
mcore.usys.aspect.use: true
mcore.notpdelay: true
# -------------------------------------------- #
# KITS
@ -84,24 +84,24 @@ permissions:
default: false
children:
mcore.kit.rank0: true
mcore.cmd.mcore.id: true
mcore.cmd.mcore.mstore: true
mcore.cmd.mcore.mstore.stats: true
mcore.cmd.mcore.mstore.listcolls: true
mcore.cmd.mcore.usys: true
mcore.cmd.mcore.usys.multiverse: true
mcore.cmd.mcore.usys.multiverse.list: true
mcore.cmd.mcore.usys.multiverse.show: true
mcore.cmd.mcore.usys.aspect: true
mcore.cmd.mcore.usys.aspect.list: true
mcore.cmd.mcore.usys.aspect.show: true
mcore.id: true
mcore.mstore: true
mcore.mstore.stats: true
mcore.mstore.listcolls: true
mcore.usys: true
mcore.usys.multiverse: true
mcore.usys.multiverse.list: true
mcore.usys.multiverse.show: true
mcore.usys.aspect: true
mcore.usys.aspect.list: true
mcore.usys.aspect.show: true
mcore.notpdelay: true
mcore.kit.rank0:
default: false
children:
mcore.cmd.mcore: true
mcore.cmd.mcore.hearsound: true
mcore.cmd.mcore.version: true
mcore.basecommand: true
mcore.hearsound: true
mcore.version: true
mcore.kit.default:
default: true
children:

View File

@ -10,30 +10,29 @@ public enum MCorePerm
// ENUM
// -------------------------------------------- //
CMD_MCORE("cmd.mcore"),
CMD_MCORE_ID("cmd.mcore.id"),
CMD_MCORE_VERSION("cmd.mcore.version"),
CMD_MCORE_HEARSOUND("cmd.mcore.hearsound"),
CMD_MCORE_MSTORE("cmd.mcore.mstore"),
CMD_MCORE_MSTORE_STATS("cmd.mcore.mstore.stats"),
CMD_MCORE_MSTORE_LISTCOLLS("cmd.mcore.mstore.listcolls"),
CMD_MCORE_MSTORE_COPYDB("cmd.mcore.mstore.copydb"),
CMD_MCORE_USYS("cmd.mcore.usys"),
CMD_MCORE_USYS_MULTIVERSE("cmd.mcore.usys.multiverse"),
CMD_MCORE_USYS_MULTIVERSE_LIST("cmd.mcore.usys.multiverse.list"),
CMD_MCORE_USYS_MULTIVERSE_SHOW("cmd.mcore.usys.multiverse.show"),
CMD_MCORE_USYS_MULTIVERSE_NEW("cmd.mcore.usys.multiverse.new"),
CMD_MCORE_USYS_MULTIVERSE_DEL("cmd.mcore.usys.multiverse.del"),
CMD_MCORE_USYS_UNIVERSE("cmd.mcore.usys.universe"),
CMD_MCORE_USYS_UNIVERSE_NEW("cmd.mcore.usys.universe.new"),
CMD_MCORE_USYS_UNIVERSE_DEL("cmd.mcore.usys.universe.del"),
CMD_MCORE_USYS_UNIVERSE_CLEAR("cmd.mcore.usys.universe.clear"),
CMD_MCORE_USYS_WORLD("cmd.mcore.usys.world"),
CMD_MCORE_USYS_ASPECT("cmd.mcore.usys.aspect"),
CMD_MCORE_USYS_ASPECT_LIST("cmd.mcore.usys.aspect.list"),
CMD_MCORE_USYS_ASPECT_SHOW("cmd.mcore.usys.aspect.show"),
CMD_MCORE_USYS_ASPECT_USE("cmd.mcore.usys.aspect.use"),
BASECOMMAND("basecommand"),
ID("id"),
VERSION("version"),
HEARSOUND("hearsound"),
MSTORE("mstore"),
MSTORE_STATS("mstore.stats"),
MSTORE_LISTCOLLS("mstore.listcolls"),
MSTORE_COPYDB("mstore.copydb"),
USYS("usys"),
USYS_MULTIVERSE("usys.multiverse"),
USYS_MULTIVERSE_LIST("usys.multiverse.list"),
USYS_MULTIVERSE_SHOW("usys.multiverse.show"),
USYS_MULTIVERSE_NEW("usys.multiverse.new"),
USYS_MULTIVERSE_DEL("usys.multiverse.del"),
USYS_UNIVERSE("usys.universe"),
USYS_UNIVERSE_NEW("usys.universe.new"),
USYS_UNIVERSE_DEL("usys.universe.del"),
USYS_UNIVERSE_CLEAR("usys.universe.clear"),
USYS_WORLD("usys.world"),
USYS_ASPECT("usys.aspect"),
USYS_ASPECT_LIST("usys.aspect.list"),
USYS_ASPECT_SHOW("usys.aspect.show"),
USYS_ASPECT_USE("usys.aspect.use"),
NOTPDELAY("notpdelay"),
// END OF LIST

View File

@ -36,7 +36,7 @@ public class ARAspect extends ARAbstractSelect<Aspect>
@Override
public boolean canList(CommandSender sender)
{
return MCorePerm.CMD_MCORE_USYS_ASPECT_LIST.has(sender, false);
return MCorePerm.USYS_ASPECT_LIST.has(sender, false);
}
@Override

View File

@ -36,7 +36,7 @@ public class ARMultiverse extends ARAbstractSelect<Multiverse>
@Override
public boolean canList(CommandSender sender)
{
return MCorePerm.CMD_MCORE_USYS_MULTIVERSE_LIST.has(sender, false);
return MCorePerm.USYS_MULTIVERSE_LIST.has(sender, false);
}
@Override

View File

@ -16,7 +16,7 @@ public class CmdMCore extends MCommand
public CmdMCoreMStore cmdMCoreMStore = new CmdMCoreMStore();
public CmdMCoreId cmdMCoreId = new CmdMCoreId();
public CmdMCoreHearsound cmdMCoreHearsound = new CmdMCoreHearsound();
public VersionCommand cmdMCoreVersion = new VersionCommand(MCore.get(), MCorePerm.CMD_MCORE_VERSION.node, "v", "version");
public VersionCommand cmdMCoreVersion = new VersionCommand(MCore.get(), MCorePerm.VERSION.node, "v", "version");
// -------------------------------------------- //
// CONSTRUCT
@ -32,7 +32,7 @@ public class CmdMCore extends MCommand
this.addSubCommand(this.cmdMCoreVersion);
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.BASECOMMAND.node));
}
}

View File

@ -25,7 +25,7 @@ public class CmdMCoreHearsound extends MCommand
this.setErrorOnToManyArgs(false);
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_HEARSOUND.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.HEARSOUND.node));
this.addRequirements(ReqIsPlayer.get());
}

View File

@ -17,7 +17,7 @@ public class CmdMCoreId extends MCommand
this.addAliases("id");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_ID.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.ID.node));
}
// -------------------------------------------- //

View File

@ -29,7 +29,7 @@ public class CmdMCoreMStore extends MCommand
this.addAliases("mstore");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_MSTORE.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.MSTORE.node));
}
}

View File

@ -30,7 +30,7 @@ public class CmdMCoreMStoreCopydb extends MCommand
this.addRequiredArg("to");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_MSTORE_COPYDB.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.MSTORE_COPYDB.node));
}
// -------------------------------------------- //

View File

@ -29,7 +29,7 @@ public class CmdMCoreMStoreListcolls extends MCommand
this.addOptionalArg("db", ConfServer.dburi);
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_MSTORE_LISTCOLLS.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.MSTORE_LISTCOLLS.node));
}
// -------------------------------------------- //

View File

@ -26,7 +26,7 @@ public class CmdMCoreMStoreStats extends MCommand
this.addOptionalArg("coll", Coll.TOTAL);
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_MSTORE_STATS.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.MSTORE_STATS.node));
}
// -------------------------------------------- //

View File

@ -31,7 +31,7 @@ public class CmdMCoreUsys extends MCommand
this.addAliases("usys");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.USYS.node));
}
}

View File

@ -29,7 +29,7 @@ public class CmdMCoreUsysAspect extends MCommand
this.addAliases("a", "aspect");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_ASPECT.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.USYS_ASPECT.node));
}
}

View File

@ -26,7 +26,7 @@ public class CmdMCoreUsysAspectList extends MCommand
this.addOptionalArg("page", "1");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_ASPECT_LIST.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.USYS_ASPECT_LIST.node));
}
// -------------------------------------------- //

View File

@ -22,7 +22,7 @@ public class CmdMCoreUsysAspectShow extends MCommand
this.addRequiredArg("aspect");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_ASPECT_SHOW.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.USYS_ASPECT_SHOW.node));
}
// -------------------------------------------- //

View File

@ -24,7 +24,7 @@ public class CmdMCoreUsysAspectUse extends MCommand
this.addRequiredArg("multiverse");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_ASPECT_USE.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.USYS_ASPECT_USE.node));
}
// -------------------------------------------- //

View File

@ -31,7 +31,7 @@ public class CmdMCoreUsysMultiverse extends MCommand
this.addAliases("m", "multiverse");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_MULTIVERSE.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.USYS_MULTIVERSE.node));
}
}

View File

@ -22,7 +22,7 @@ public class CmdMCoreUsysMultiverseDel extends MCommand
this.addRequiredArg("multiverse");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_MULTIVERSE_DEL.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.USYS_MULTIVERSE_DEL.node));
}
// -------------------------------------------- //

View File

@ -26,7 +26,7 @@ public class CmdMCoreUsysMultiverseList extends MCommand
this.addOptionalArg("page", "1");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_MULTIVERSE_LIST.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.USYS_MULTIVERSE_LIST.node));
}
// -------------------------------------------- //

View File

@ -20,7 +20,7 @@ public class CmdMCoreUsysMultiverseNew extends MCommand
this.addRequiredArg("multiverse");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_MULTIVERSE_NEW.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.USYS_MULTIVERSE_NEW.node));
}
// -------------------------------------------- //

View File

@ -27,7 +27,7 @@ public class CmdMCoreUsysMultiverseShow extends MCommand
this.addRequiredArg("multiverse");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_MULTIVERSE_SHOW.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.USYS_MULTIVERSE_SHOW.node));
}
// -------------------------------------------- //

View File

@ -29,7 +29,7 @@ public class CmdMCoreUsysUniverse extends MCommand
this.addAliases("u", "universe");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_UNIVERSE.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.USYS_UNIVERSE.node));
}
}

View File

@ -23,7 +23,7 @@ public class CmdMCoreUsysUniverseClear extends MCommand
this.addRequiredArg("multiverse");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_UNIVERSE_CLEAR.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.USYS_UNIVERSE_CLEAR.node));
}
// -------------------------------------------- //

View File

@ -23,7 +23,7 @@ public class CmdMCoreUsysUniverseDel extends MCommand
this.addRequiredArg("multiverse");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_MULTIVERSE_DEL.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.USYS_MULTIVERSE_DEL.node));
}
// -------------------------------------------- //

View File

@ -22,7 +22,7 @@ public class CmdMCoreUsysUniverseNew extends MCommand
this.addRequiredArg("multiverse");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_UNIVERSE_NEW.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.USYS_UNIVERSE_NEW.node));
}
// -------------------------------------------- //

View File

@ -23,7 +23,7 @@ public class CmdMCoreUsysWorld extends MCommand
this.addRequiredArg("multiverse");
// Requirements
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_WORLD.node));
this.addRequirements(ReqHasPerm.get(MCorePerm.USYS_WORLD.node));
}
// -------------------------------------------- //