3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-07 03:50:06 +01:00

Added hierarchical permissions support to permission resolvers, improved Permissions support.

Dieser Commit ist enthalten in:
sk89q 2011-01-29 09:01:21 -08:00
Ursprung 02de4c8200
Commit f683959420
4 geänderte Dateien mit 21 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -94,6 +94,13 @@ public class ConfigurationPermissionsResolver implements PermissionsResolver {
}
public boolean hasPermission(String player, String permission) {
int dotPos = permission.lastIndexOf(".");
if (dotPos > -1) {
if (hasPermission(player, permission.substring(0, dotPos))) {
return true;
}
}
Set<String> perms = userPermissionsCache.get(player.toLowerCase());
if (perms == null) {
return defaultPermissionsCache.contains(permission)

Datei anzeigen

@ -153,6 +153,13 @@ public class FlatFilePermissionsResolver implements PermissionsResolver {
}
public boolean hasPermission(String player, String permission) {
int dotPos = permission.lastIndexOf(".");
if (dotPos > -1) {
if (hasPermission(player, permission.substring(0, dotPos))) {
return true;
}
}
Set<String> perms = userPermissionsCache.get(player.toLowerCase());
if (perms == null) {
return defaultPermissionsCache.contains(permission)

Datei anzeigen

@ -55,6 +55,12 @@ public class GroupUsersPemissionsResolver implements PermissionsResolver {
try {
Player player = server.getPlayer(name);
if (player == null) return false;
int dotPos = permission.lastIndexOf(".");
if (dotPos > -1) {
if (hasPermission(name, permission.substring(0, dotPos))) {
return true;
}
}
return groupUsers.playerCanUseCommand(player, permission);
} catch (Throwable t) {
t.printStackTrace();

Datei anzeigen

@ -67,7 +67,7 @@ public class NijiPermissionsResolver implements PermissionsResolver {
try {
Player player = server.getPlayer(name);
if (player == null) return false;
return group.equals(api.Security.getGroup(player.getName()));
return api.Security.inGroup(name, group);
} catch (Throwable t) {
t.printStackTrace();
return false;