#415 Move some permission nodes out of authme.player.*

- Move certain permission nodes outside of the authme.player branch
- Update classes / permissions list
- Remove wildcard node from code completely (since not used)
This commit is contained in:
ljacqu
2016-02-14 14:15:02 +01:00
parent 5dc1598f6e
commit b3734f4010
16 changed files with 169 additions and 101 deletions
@@ -100,10 +100,10 @@ public enum AdminPermission implements PermissionNode {
*/
RELOAD("authme.admin.reload"),
/**
* Give access to all admin commands.
*/
ADMIN_ALL("authme.admin.*");
/**
* Permission to see the other accounts of the players that log in.
*/
SEE_OTHER_ACCOUNTS("authme.admin.seeotheraccounts");
/**
* The permission node.
@@ -124,8 +124,4 @@ public enum AdminPermission implements PermissionNode {
return node;
}
@Override
public PermissionNode getWildcardNode() {
return ADMIN_ALL;
}
}
@@ -28,7 +28,7 @@ public enum DefaultPermission {
/**
* Return the textual representation.
*
* @return String
* @return The textual representation
*/
public String getTitle() {
return title;
@@ -12,11 +12,4 @@ public interface PermissionNode {
*/
String getNode();
/**
* Return the wildcard node that also grants the permission.
*
* @return The wildcard permission node (e.g. "authme.player.*")
*/
PermissionNode getWildcardNode();
}
@@ -299,7 +299,6 @@ public class PermissionsManager implements PermissionsService {
Player player = (Player) sender;
return hasPermission(player, permissionNode.getNode(), def);
// || hasPermission(player, permissionNode.getWildcardNode().getNode(), def);
}
public boolean hasPermission(Player player, Iterable<PermissionNode> nodes, boolean def) {
@@ -5,16 +5,6 @@ package fr.xephi.authme.permission;
*/
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.
*/
@@ -65,26 +55,6 @@ public enum PlayerPermission implements PermissionNode {
*/
CAN_LOGIN_BE_FORCED("authme.player.canbeforced"),
/**
* Permission for users to bypass force-survival mode.
*/
BYPASS_FORCE_SURVIVAL("authme.player.bypassforcesurvival"),
/**
* Permission for users to allow two accounts.
*/
ALLOW_MULTIPLE_ACCOUNTS("authme.player.allow2accounts"),
/**
* Permission for user to see other accounts.
*/
SEE_OTHER_ACCOUNTS("authme.player.seeotheraccounts"),
/**
* Permission to use all player (non-admin) commands.
*/
PLAYER_ALL("authme.player.*"),
/**
* Permission to use to see own other accounts.
*/
@@ -109,8 +79,4 @@ public enum PlayerPermission implements PermissionNode {
return node;
}
@Override
public PermissionNode getWildcardNode() {
return PLAYER_ALL;
}
}
@@ -0,0 +1,47 @@
package fr.xephi.authme.permission;
/**
* Permission nodes that give a player a status (e.g. VIP)
* or grant them more freedom (e.g. less restrictions).
*/
public enum PlayerStatePermission implements PermissionNode {
/**
* Permission node to bypass AntiBot protection.
*/
BYPASS_ANTIBOT("authme.bypassantibot"),
/**
* Permission for users to bypass force-survival mode.
*/
BYPASS_FORCE_SURVIVAL("authme.bypassforcesurvival"),
/**
* Permission node to identify VIP users.
*/
IS_VIP("authme.vip"),
/**
* Permission to be able to register multiple accounts.
*/
ALLOW_MULTIPLE_ACCOUNTS("authme.allowmultipleaccounts");
/**
* The permission node.
*/
private String node;
/**
* Constructor.
*
* @param node Permission node.
*/
PlayerStatePermission(String node) {
this.node = node;
}
@Override
public String getNode() {
return node;
}
}