From 25752ff710f1d796fc82cf529e42464b708bba43 Mon Sep 17 00:00:00 2001 From: MarioE Date: Sun, 19 Aug 2012 21:16:16 -0400 Subject: [PATCH] Fix an oversight --- TShockAPI/Group.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; }