Commit eef216ae authored by lhhxxxxx's avatar lhhxxxxx Committed by Melledy
Browse files

Update Account.hasPermission()

Add wildcard characters to permission nodes under the same namespace. (simple implementation)
parent 286ab545
...@@ -104,7 +104,10 @@ public class Account { ...@@ -104,7 +104,10 @@ public class Account {
} }
public boolean hasPermission(String permission) { public boolean hasPermission(String permission) {
return this.permissions.contains(permission) || this.permissions.contains("*") ? true : false; return this.permissions.contains(permission) ||
this.permissions.contains("*") ||
(this.permissions.contains("player") || this.permissions.contains("player.*")) && permission.startsWith("player.") ||
(this.permissions.contains("server") || this.permissions.contains("server.*")) && permission.startsWith("server.");
} }
public boolean removePermission(String permission) { public boolean removePermission(String permission) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment