Merge branch 'master' of https://github.com/AuthMe-Team/AuthMeReloaded into command-perms-refactor

Conflicts:
	src/main/java/fr/xephi/authme/command/CommandDescription.java
	src/main/java/fr/xephi/authme/command/CommandInitializer.java
This commit is contained in:
ljacqu
2015-12-01 20:43:49 +01:00
21 changed files with 357 additions and 216 deletions
@@ -1,55 +1,125 @@
package fr.xephi.authme.permission;
/**
* AuthMe admin permissions.
* AuthMe admin command permissions.
*/
public enum AdminPermission implements PermissionNode {
REGISTER("authme.admin.register"),
/**
* Administrator command to register a new user.
*/
REGISTER("authme.command.admin.register"),
UNREGISTER("authme.admin.unregister"),
/**
* Administrator command to unregister an existing user.
*/
UNREGISTER("authme.command.admin.unregister"),
FORCE_LOGIN("authme.admin.forcelogin"),
/**
* Administrator command to force-login an existing user.
*/
FORCE_LOGIN("authme.command.admin.forcelogin"),
CHANGE_PASSWORD("authme.admin.changepassword"),
/**
* Administrator command to change the password of a user.
*/
CHANGE_PASSWORD("authme.command.admin.changepassword"),
LAST_LOGIN("authme.admin.lastlogin"),
/**
* Administrator command to see the last login date and time of an user.
*/
LAST_LOGIN("authme.command.admin.lastlogin"),
ACCOUNTS("authme.admin.accounts"),
/**
* Administrator command to see all accounts associated with an user.
*/
ACCOUNTS("authme.command.admin.accounts"),
GET_EMAIL("authme.admin.getemail"),
/**
* Administrator command to get the email address of an user, if set.
*/
GET_EMAIL("authme.command.admin.getemail"),
CHANGE_EMAIL("authme.admin.chgemail"),
/**
* Administrator command to set or change the email adress of an user.
*/
CHANGE_EMAIL("authme.command.admin.changemail"),
GET_IP("authme.admin.getip"),
/**
* Administrator command to get the last known IP of an user.
*/
GET_IP("authme.command.admin.getip"),
SPAWN("authme.admin.spawn"),
/**
* Administrator command to teleport to the AuthMe spawn.
*/
SPAWN("authme.command.admin.spawn"),
SET_SPAWN("authme.admin.setspawn"),
/**
* Administrator command to set the AuthMe spawn.
*/
SET_SPAWN("authme.command.admin.setspawn"),
FIRST_SPAWN("authme.admin.firstspawn"),
/**
* Administrator command to teleport to the first AuthMe spawn.
*/
FIRST_SPAWN("authme.command.admin.firstspawn"),
SET_FIRST_SPAWN("authme.admin.setfirstspawn"),
/**
* Administrator command to set the first AuthMe spawn.
*/
SET_FIRST_SPAWN("authme.command.admin.setfirstspawn"),
PURGE("authme.admin.purge"),
/**
* Administrator command to purge old user data.
*/
PURGE("authme.command.admin.purge"),
PURGE_LAST_POSITION("authme.admin.purgelastpos"),
/**
* Administrator command to purge the last position of an user.
*/
PURGE_LAST_POSITION("authme.command.admin.purgelastpos"),
PURGE_BANNED_PLAYERS("authme.admin.purgebannedplayers"),
/**
* Administrator command to purge all data associated with banned players.
*/
PURGE_BANNED_PLAYERS("authme.command.admin.purgebannedplayers"),
SWITCH_ANTIBOT("authme.admin.switchantibot"),
/**
* Administrator command to toggle the AntiBot protection status.
*/
SWITCH_ANTIBOT("authme.command.admin.switchantibot"),
RELOAD("authme.admin.reload");
/**
* Administrator command to convert old or other data to AuthMe data.
*/
CONVERTER("authme.command.admin.converter"),
/**
* Administrator command to reload the plugin configuration.
*/
RELOAD("authme.command.admin.reload");
/**
* Permission node.
*/
private String node;
/**
* Get the permission node.
* @return
*/
@Override
public String getNode() {
return node;
}
/**
* Constructor.
*
* @param node Permission node.
*/
AdminPermission(String node) {
this.node = node;
}
}
@@ -0,0 +1,106 @@
package fr.xephi.authme.permission;
/**
* AuthMe player permission nodes, for regular players.
*/
public enum PlayerPermission implements PermissionNode {
/**
* Permission node to bypass AntiBot protection.
*/
BYPASS_ANTIBOT("authme.player.bypassantibot"),
/**
* Permission node to identify VIP users.
*/
IS_VIP("authme.player.vip"),
/**
* Command permission to login.
*/
LOGIN("authme.command.player.login"),
/**
* Command permission to logout.
*/
LOGOUT("authme.command.player.logout"),
/**
* Command permission to register.
*/
REGISTER("authme.command.player.register"),
/**
* Command permission to unregister.
*/
UNREGISTER("authme.command.player.unregister"),
/**
* Command permission to change the password.
*/
CHANGE_PASSWORD("authme.command.player.changepassword"),
/**
* Command permission to add an email address.
*/
ADD_EMAIL("authme.command.player.email.add"),
/**
* Command permission to change the email address.
*/
CHANGE_EMAIL("authme.command.player.email.change"),
/**
* Command permission to recover an account using it's email address.
*/
RECOVER_EMAIL("authme.command.player.email.recover"),
/**
* Command permission to use captcha.
*/
CAPTCHA("authme.command.player.captcha"),
/**
* Permission for users a login can be forced to.
*/
CAN_LOGIN_BE_FORCED("authme.player.canbeforced"),
/**
* Permission for users to bypass force-survival mode.
*/
BYPASS_FORCE_SURVIVAL("authme.command.player.bypassforcesurvival"),
/**
* Permission for users to allow two accounts.
*/
ALLOW_MULTIPLE_ACCOUNTS("authme.command.player.allow2accounts"),
/**
* Permission for user to see other accounts.
*/
SEE_OTHER_ACCOUNTS("authme.command.player.seeotheraccounts");
/**
* Permission node.
*/
private String node;
/**
* Get the permission node.
*
* @return Permission node.
*/
@Override
public String getNode() {
return node;
}
/**
* Constructor.
*
* @param node Permission node.
*/
PlayerPermission(String node) {
this.node = node;
}
}
@@ -1,52 +0,0 @@
package fr.xephi.authme.permission;
/**
* AuthMe user permission nodes.
*/
public enum UserPermission implements PermissionNode {
BYPASS_ANTIBOT("authme.bypassantibot"),
IS_VIP("authme.vip"),
LOGIN("authme.login"),
LOGOUT("authme.logout"),
REGISTER("authme.register"),
UNREGISTER("authme.unregister"),
CHANGE_PASSWORD("authme.changepassword"),
ADD_EMAIL("authme.email.add"),
CHANGE_EMAIL("authme.email.change"),
RECOVER_EMAIL("authme.email.recover"),
CAPTCHA("authme.captcha"),
CONVERTER("authme.converter"),
CAN_LOGIN_BE_FORCED("authme.canbeforced"),
BYPASS_FORCE_SURVIVAL("authme.bypassforcesurvival"),
ALLOW_MULTIPLE_ACCOUNTS("authme.allow2accounts"),
SEE_OTHER_ACCOUNTS("authme.seeOtherAccounts");
private String node;
@Override
public String getNode() {
return node;
}
UserPermission(String node) {
this.node = node;
}
}