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>
|
/// <returns>Returns true if the user has that permission.</returns>
|
||||||
public virtual bool HasPermission(string permission)
|
public virtual bool HasPermission(string permission)
|
||||||
{
|
{
|
||||||
string[] nodes = permission.Split('.');
|
if (String.IsNullOrEmpty(permission) || RealHasPermission(permission))
|
||||||
for (int i = nodes.Length - 1; i >= 0; i--)
|
|
||||||
{
|
|
||||||
if (RealHasPermission(String.Join(".", nodes)))
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
string[] nodes = permission.Split('.');
|
||||||
|
for (int i = nodes.Length - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
nodes[i] = "*";
|
nodes[i] = "*";
|
||||||
|
if (RealHasPermission(String.Join(".", nodes, 0, i + 1)))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue