LuckPerms

LuckPerms

917k Downloads

import data under specific context

Andre601 opened this issue ยท 2 comments

commented

I think it would be a beneficial thing to have an optional context option for the /lp import command to import the data of an export-file in a specific context.
That would be especially useful in cases where a user switches from a network using LP with separate storages to one with a central, remote-database.
The issue you face there is that - to my knowledge - the import command overrides every existing perm-setup, meaning it will remove/destroy any previously set perms in the database, causing issues.

The thing that would be the question now is, how would data, which has context set be handled?
Like when you do /lp import my-backup server=survival, how would perms be handled that already have a world and server context set?
Would the context be overriden? Or make it not change context?

Perhaps the import command could be changed in a way, where first arg is file, second is a bollean to set if it's forced or not and 3rd+ is context.

That way could /lp import backup true server=creative forcefully override all the same, existing perms with this exact same context and /lp import backup false server=creative would skip perms that are already set in a specific context and wouldn't override the context of other perms.

I hope all of this makes sense.

commented

Understood - however I think this would be better suited as functionality in the bulkupdate command.

#1836

commented

I mean how?
When you want to import data at a certain context into an already existing database how could bulkupdate ever be useful here?
(Unless you mean bulkupdate allows importing data too. But the question would remain as to why not just give import the functionality so the data gets modified before it hits the database)