diff --git a/TShockAPI/Group.cs b/TShockAPI/Group.cs index f5f105ea..155b4098 100644 --- a/TShockAPI/Group.cs +++ b/TShockAPI/Group.cs @@ -174,14 +174,18 @@ namespace TShockAPI /// Returns true if the user has that permission. public virtual bool HasPermission(string permission) { + if (String.IsNullOrEmpty(permission) || RealHasPermission(permission)) + { + return true; + } string[] nodes = permission.Split('.'); for (int i = nodes.Length - 1; i >= 0; i--) { - if (RealHasPermission(String.Join(".", nodes))) + nodes[i] = "*"; + if (RealHasPermission(String.Join(".", nodes, 0, i + 1))) { return true; } - nodes[i] = "*"; } return false; }