LuckPerms

LuckPerms

41.4k Downloads

Bulkedit: Update Multiple Perms

OmegaWeaponDev opened this issue ยท 10 comments

commented

With how you can update a permission and change it to another, there needs to be a way you can change one perm into multiple permissions at once.

commented

Could you elaborate? I'm curious as to what you mean.

commented

It's a suggestion. Just to make it so you can bulkupdate permissions to change perms to multi perms.

Like change test.permission123 to test.permission1 test.permission2 test permission.3 etc.. atm you can only chang3 the permission to another one. This one will update it and change it to multiple perms.

commented

So basically an automatic rule?
So if it detects that a group has got test.permission123 it automatically replaces it with test.permission1, test.permission2 and test.permission3?

Something like that could be considered useful. But rather than using the Bulk edit command it would be better to have luckperms create its own permission nodes which the user can define in a JSON file or yml.

eg.
test.permission123 { test.permission1, test.permission2, test.permission3 }
I reckon that would be useful. That way the user can define permissions nodes such as serverrank.administrator and serverrank.moderator which could include all the permissions for those ranks.

But I feel like that would recreate the Inheritance effect.

Is this what you mean?

commented

Pretty much if you had test.permission123 you type something like /lp bulkupdate all update test.permission1, test.permission2 test.permission3 "permission == test.permission123"

commented

What purpose would that serve though?

You'd be better off just deleting the node and adding the other three.
Could you provide a scenario? As in a real world application of this feature.

commented

Say you have a donation permission like mydonation.perks on 30+ players. The plugin updates and the permissions change to mydonation.perks.pack1 mydonation.perks.pack2 mydonation.perks.pack3.

You'd run the command /lp bulkupdate update all mydonation.perks.pack, mydonation.perks.pack2 "permission == mydonations.perks"

So it would replace mydonation.perks on those 30+ players with the three new permissions.

commented

Okay, that does make sense and would be quite practical if you needed to update a certain permission (Lets say you got a new plugin that needed three nodes for a function that your previous plugin only needed one for) and would need to update the permission for several players (if the permissions were added on a player basis) or for several groups (If the permissions were added on a group basis)

I also think this would be a good feature. ๐Ÿ‘

commented

Could you use bulkupdate to replace it with a group node and are the perms to the group?
Like
lp creategroup test
lp bulkupdate update all group.test "permission == donorperm.whatever"

commented

It's not possible to implement this sort of behaviour using single SQL replacement queries, which is what the bulkupdate command uses.

Sooo, unfortunately not something that can be added. The suggestion about replacing a single permission with a group is what I was going to suggest.

commented

I'm not making a group for every time I need to update perms for a single perk