mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-12-01 06:53:26 +01:00
Fixed check for permissions not in the enum
This commit is contained in:
parent
0ccbc58be1
commit
eed8427eb1
@ -153,6 +153,10 @@ public enum DPermissions {
|
||||
* @return if the player has the permission
|
||||
*/
|
||||
public static boolean hasPermission(CommandSender sender, String permission) {
|
||||
if (sender.hasPermission(permission)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
DPermissions dPermission = null;
|
||||
if (EnumUtil.isValidEnum(DPermissions.class, permission)) {
|
||||
dPermission = DPermissions.valueOf(permission);
|
||||
@ -165,7 +169,13 @@ public enum DPermissions {
|
||||
return false;
|
||||
}
|
||||
|
||||
return hasPermission(sender, dPermission);
|
||||
for (DPermissions parent : DPermissions.values()) {
|
||||
if (parent.getChildren().contains(dPermission) && sender.hasPermission(parent.getNode())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user