mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-25 16:32:53 +08:00
Update Account.hasPermission()
Add wildcard characters to permission nodes under the same namespace. (simple implementation)
This commit is contained in:
parent
286ab545e9
commit
eef216aea8
@ -104,7 +104,10 @@ public class Account {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user