private void save() {
        if (!getData().has("flags"))
            getData().put("flags", new JSONObject());
        JSONObject flags = getData().getJSONObject("flags");
        if (flags == null) {
            flags = new JSONObject();
            getData().put("flags", flags);
        }
        for (Map.Entry<PermissionFlag, Boolean> flag : this.flagsMap.entrySet()) {
            flags.put(flag.getKey().getName(), flag.getValue());
        }
    }