Fix an oversight
This commit is contained in:
parent
5e14d751b9
commit
25752ff710
1 changed files with 6 additions and 2 deletions
|
|
@ -174,14 +174,18 @@ namespace TShockAPI
|
|||
/// <returns>Returns true if the user has that permission.</returns>
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue