LuckPerms

LuckPerms

41.4k Downloads

Bulk deleting over API?

baba43 opened this issue ยท 1 comments

commented

Hey,

first of all, let me say that this project is awesome. Thank you very much for all the effort that you have put into it. We really enjoy working with LuckPerms.

I would like to know, what would be the best idea to accomplish bulk editing over your API. Once a month, we need to remove all players from a bunch of groups. Of course I can write SQL to do so, but I'm caring about synchronisation then. My second (hacky) idea was to use your CLI (/lpb bulkupdate) but that won't work because the command needs to be confirmed.

Can you give us a little help? :-)

commented

Currently not possible with the API, and unlikely to be in the future.

The code for the bulkupdate system isn't very compact, and I'm not really comfortable exposing it in the API directly at the moment, as it prevents me from changing the implementation as freely in the future.

https://github.com/lucko/LuckPerms/tree/master/common/src/main/java/me/lucko/luckperms/common/bulkupdate

My suggestion would be to just execute the SQL query directly (since that's effectively all that bulkupdate does!), and then calling the sync method - either by running /lpb sync as console, or using the LuckPermsApi#runUpdateTask method in the API.

I hope that answers your question. :)