public PermissionProvider loadPlayerPermissions(String name, String world) {
if (world != null && world.isEmpty()) {
world = null;
}
// Database.get().remove("permission", new String[] {"owner", "type"}, new Object[] {group.getName(), "group"});
PermissionProvider provider = new MultiworldPermissionProvider(world, true, name);
ArrayList<DataAccess> dataList = new ArrayList<DataAccess>();
try {
Database.get().loadAll(new PermissionDataAccess(world), dataList, new String[]{ "owner", "type" }, new Object[]{ name, "player" });
for (DataAccess da : dataList) {
PermissionDataAccess data = (PermissionDataAccess) da;
provider.addPermission(data.path, data.value, data.id);
}
}
catch (DatabaseReadException e) {
Canary.logStacktrace(e.getMessage(), e);
}