LuckPerms

LuckPerms

41.4k Downloads

Import/export changes

lucko opened this issue ยท 10 comments

commented

Change from a "list of commands" format to JSON format.

Easier to apply, less prone to corruption issues.

commented
commented

I would appreciate an option to re-enable legacy export of "list of commands", it is very beneficial to make mass edits using Sublime text editor.

commented

@MinecraftAdmin probably best to open a new issue for that. There are quite a few people who want the legacy export back.

commented

Also, the export was afaik never meant to be editable?
It was meant as an easy backup-method and for switching storage.

And if you want to f.e. import info with context, take a look at #1991 as suggestion and perhaps give your opinion on it.

commented

Maybe if it followed the same pattern as the web editor data?

Then you could have one method which can handle both use cases.

commented

So how would this new export file look like?

commented

I can't speak for Luck, but I'm having something like this in mind:

{
"groups": [
"group1": [
{"some.perm", true, "context": [
"worldcontext",
"servercontext",
"proxycontext"
]
}
]
],
"tracks": [
{"sometrack", "groups": [
{"group1", 1}, {"group2", 2}
]
}
],
"users": [
"uuid123": [
//same as with groups
]
]
}
commented

I think something like this could be useful... But maybe a bit much

{
  "groups": [{
    "admin": [{
      "type": "permission",
      "content": "luckperms.*",
      "value": true,
      "context": {}
    },
    {
      "type": "prefix",
      "content": "&7[&cAdmin&7] ",
      "context": {
        "server": "lobby"
      }
    }]
  },
  {
    "default": [{
      "type": "displayname",
      "content": "guest",
      "context":{
        "server": "survival",
        "world": "world"
      }
    },
    {
      "type": "permission",
      "content": "essentials.fly",
      "value": true,
      "context": {
        "world": "creative"
      }
    }]
  }],
  "tracks": [{
    "track1": [{
      "group": "default",
      "position": 0
    },
    {
      "group": "member",
      "position": 1
    }]
  }],
  "users": [{
    "-- UUID of user --": [{
      "type": "group",
      "content": "default",
      "context": {}
    }]
  }]
}
commented

Maybe if it followed the same pattern as the web editor data?

Then you could have one method which can handle both use cases.

Yeah. I think it would be a good thing to have the style similar, if not the same to how the one is for the web editor.
Could perhaps even reduce code by using the same system from the editor, just without the uploading.

commented

Another idea would be to have it similar to how json storage works.