public void load(String json) {
        super.load(json);
        JSONObject flags = getData().getJSONObject("flags");
        if (flags == null) {
            flags = new JSONObject();
            getData().put("flags", flags);
        }
        if (flags.names() != null) {
            for (int i = 0; i < flags.names().length(); i++) {
                String flagName = flags.names().get(i).toString();
                PermissionFlag flag = ChunkyPermissions.getFlag(flagName);
                if (flag == null) {
                    Logging.warning("Permission flag \"" + flagName + "\" is missing.  Registering it as new permission flag.");
                    flag = new PermissionFlag(flagName, flagName);
                    ChunkyPermissions.registerPermissionFlag(flag);
                }
                try {
                    boolean hasPerm = flags.getBoolean(flagName);
                    this.flagsMap.put(flag, hasPerm);
                } catch (JSONException e) {
                    Logging.warning("Faulty permission flag data for " + flagName + ". Must be boolean value.");
                    Logging.warning(e.getMessage());
                }
            }
        }
    }