#784 Perform bypass purge permission check with OfflinePlayer objects
- Move permission check inside PurgeTask to perform it with OfflinePlayer objects instead of lowercase names - Move purge members into child "purge" package - Unify online and offline default permission behavior in DefaultPermission
This commit is contained in:
@@ -28,7 +28,7 @@ public class BPermissionsHandler implements PermissionHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(String name, PermissionNode node) {
|
||||
public boolean hasPermissionOffline(String name, PermissionNode node) {
|
||||
return ApiLayer.hasPermission(null, CalculableType.USER, name, node.getNode());
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class GroupManagerHandler implements PermissionHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(String name, PermissionNode node) {
|
||||
public boolean hasPermissionOffline(String name, PermissionNode node) {
|
||||
final AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissionsByPlayerName(name);
|
||||
List<String> perms = handler.getAllPlayersPermissions(name);
|
||||
return perms.contains(node.getNode());
|
||||
|
||||
@@ -47,7 +47,7 @@ public interface PermissionHandler {
|
||||
*
|
||||
* @return True if the player has permission.
|
||||
*/
|
||||
boolean hasPermission(String name, PermissionNode node);
|
||||
boolean hasPermissionOffline(String name, PermissionNode node);
|
||||
|
||||
/**
|
||||
* Check whether the player is in the specified group.
|
||||
|
||||
@@ -26,7 +26,7 @@ public class PermissionsBukkitHandler implements PermissionHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(String name, PermissionNode node) {
|
||||
public boolean hasPermissionOffline(String name, PermissionNode node) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class PermissionsExHandler implements PermissionHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(String name, PermissionNode node) {
|
||||
public boolean hasPermissionOffline(String name, PermissionNode node) {
|
||||
PermissionUser user = permissionManager.getUser(name);
|
||||
return user.has(node.getNode());
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class VaultHandler implements PermissionHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(String name, PermissionNode node) {
|
||||
public boolean hasPermissionOffline(String name, PermissionNode node) {
|
||||
return vaultProvider.has("", name, node.getNode());
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ZPermissionsHandler implements PermissionHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(String name, PermissionNode node) {
|
||||
public boolean hasPermissionOffline(String name, PermissionNode node) {
|
||||
Map<String, Boolean> perms = zPermissionsService.getPlayerPermissions(null, null, name);
|
||||
if (perms.containsKey(node.getNode()))
|
||||
return perms.get(node.getNode());
|
||||
|
||||
Reference in New Issue
Block a user