LuckPerms

LuckPerms

41.4k Downloads

Bulk update Addition

Opened this issue ยท 3 comments

commented

Hi there!
I'd like to request a bulk update addition.
Let me first give an example to explain:
Let's assume I - by accident - removed the default group from users by using 'parent set' instead of 'add' (or other reasons). Now those users have a different group, however lp will not add the default group back to them because their data is not empty. Surely, when using inheritance, it does not really matter if users have default or not is said groups inherit from it, either directly or indirectly, but what if exactly that works against my setup? This could be useful for other things as well, such as adding temp ranks/perms to all existing users as appreciation by the server owner.

Example: /lp bulkupdate all add whateverthehell

Currently, with bulk update, it is not possible to plain out add to all users.
Please consider xD

commented

I personally think this would be a good idea. I have seen many times that people have requested the ability to add a permission or group to add users at once. This would also be extremely useful if you're wanting to say add a separate permission to all users if they already have another specific permission.

For example. If players had the permission essentials.fly and one day you decided that you were wanting to add the permission essentials.fly.safelogin to everyone who has the fly permission, currently you would need to manually add the permission to every user or use a helper group by adding the two permission into that group and replacing the fly permission with that helper group. Which can be confusing for most players. So having a way to add a permission to all users would be extremely useful.

commented

The "issue" here is how bulk operations work, they essentially scan storage one node at a time, it iterates through them one by one, and if it matches the constraints it applies the operation (delete / update (or rather, "edit")); it's also dependent on what storage method the plugin is using, for SQL-based storage types it delegates the task to the database engine with just a handful of instructions (UPDATE/DELETE FROM).

Alternatively though, the /lp editor command also takes some arguments, namely a "filter" one:

[filter] - if the session includes users (e.g. type = "all", "users" or "online"), it will exclude those whose nodes don't start with the provided filter. Groups are unaffected by this filter
https://luckperms.net/wiki/General-Commands#lp-editor-type-filter

Whilst not perfect on extremely large userbases with common nodes (although, that calls for using inheritance instead, which should be the case from the beginning anyway), one could use this, add a node, select it and copy to all the other users instead. It's still a manual task but that's what I thought of.
Savvy enough people will be able to use the API to query all users with a node and add another one though, but that category of people is kind of out of the question.

commented

I have seen many times that people have requested the ability to add a permission or group to add users at once

This is fundamentally poor usage - regardless of how useful or "often" people try to do it.

If you need to add a set of permissions to all users, these should be included in the default group to avoid needless replication/duplication.