private boolean applyTrackChange(JsonObject changeInfo) {
            String id = changeInfo.get("id").getAsString();

            Track track = this.plugin.getStorage().loadTrack(id).join().orElse(null);
            if (track == null) {
                track = this.plugin.getStorage().createAndLoadTrack(id, CreationCause.WEB_EDITOR).join();
                if (this.session != null) {
                    this.session.includeCreatedTrack(track);
                }
            }

            if (ArgumentPermissions.checkModifyPerms(this.plugin, this.sender, CommandPermission.APPLY_EDITS, track)) {
                Message.COMMAND_NO_PERMISSION.send(this.sender);
                return false;
            }

            List<String> before = track.getGroups();
            List<String> after = new ArrayList<>();
            changeInfo.getAsJsonArray("groups").forEach(e -> after.add(e.getAsString()));

            if (before.equals(after)) {
                return false;
            }

            Difference<String> diff = new Difference<>();
            diff.recordChanges(Difference.ChangeType.REMOVE, before);
            diff.recordChanges(Difference.ChangeType.ADD, after);

            Set<String> added = diff.getAdded();
            Set<String> removed = diff.getRemoved();

            track.setGroups(after);

            if (hasBeenReordered(before, after, added, removed)) {
                LoggedAction.build().source(this.sender).target(track)
                        .description("webeditor", "reorder", after)
                        .build().submit(this.plugin, this.sender);
            }
            for (String n : added) {
                LoggedAction.build().source(this.sender).target(track)
                        .description("webeditor", "add", n)
                        .build().submit(this.plugin, this.sender);
            }
            for (String n : removed) {
                LoggedAction.build().source(this.sender).target(track)
                        .description("webeditor", "remove", n)
                        .build().submit(this.plugin, this.sender);
            }

            Message.APPLY_EDITS_SUCCESS.send(this.sender, "track", Component.text(track.getName()));
            Message.APPLY_EDITS_SUCCESS_SUMMARY.send(this.sender, added.size(), removed.size());
            Message.APPLY_EDITS_TRACK_BEFORE.send(this.sender, before);
            Message.APPLY_EDITS_TRACK_AFTER.send(this.sender, after);

            StorageAssistant.save(track, this.sender, this.plugin);
            return true;
        }
Represents the application of a given editor session on this platform.
common/src/main/java/me/lucko/luckperms/common/webeditor/WebEditorResponse.java