Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Kieaer committed Apr 19, 2020
1 parent 25db856 commit 58e1018
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/essentials/feature/Permission.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,19 @@ public boolean check(Player player, String command) {
if (!p.error) {
JsonObject object = permission_user.get(player.name).asObject();
if (object != null) {
int size = object.get("permission").asArray().size();
/*int size = object.get("permission").asArray().size();
for (int a = 0; a < size; a++) {
String permlevel = object.get("permission").asArray().get(a).asString();
if (permlevel.equals(command) || permlevel.equals("ALL")) {
return true;
}
}*/
int size = permission.get(object.get("group").asString()).asObject().get("permission").asArray().size();
for (int a = 0; a < size; a++) {
String permlevel = permission.get(object.get("group").asString()).asObject().get("permission").asArray().get(a).asString();
if (permlevel.equals(command) || permlevel.equals("ALL")) {
return true;
}
}
} else {
return false;
Expand Down

0 comments on commit 58e1018

Please sign in to comment.