LuckPerms

LuckPerms

41.4k Downloads

Parent group with context not applying properly

Scarsz opened this issue ยท 3 comments

commented

Trying to apply a parent with any context (tested server=foo, world=world, discordsrv:linked=true) does not work as expected. I properly inherit the prefix of the target group, but none of it's permissions. It's weird, as if it only half works.

I've attached a screenshot of my user info and a checkinherits result for a permission I should have access to. Weights are properly set; default=1 & vip=2.


(https://luckperms.net/editor/8Vjdo4mXZO)

When the false permission is removed from the default group, I have access to the permission but that is once again only partially reflected in the info command (same output as above):

(https://luckperms.net/editor/eRFsCb5fyn)


On a seemingly related note, this doesn't work either: https://luckperms.net/editor/JluErol3zf

A given permission is false in the default group. The default group has the vip group as a parent. The vip has the given permission true. The end result of a player who's parent is set to the default group is that they don't have the permission, even though the vip group has a higher weight.

commented

an inherited permission from a higher weighted parent that the user doesn't have directly, but inherits through a lower weighted parent, will not override though the group it's in has higher weight. Is this a rule perhaps? Seems counter intuitive - weight of a parent, whether directly added to the user or inherited through a lower weight group, should cause the perms in that parent to take precedence.

commented

Ben found the problem - default is inheriting the weight.2 node from vip, making them the same weight and therefore default applies. Potential fix is probably to set weight.2 to false in group default? Not sure if that would result in intended effect or not, though.

commented

Weight nodes are not inherited.

A given permission is false in the default group. The default group has the vip group as a parent. The vip has the given permission true. The end result of a player who's parent is set to the default group is that they don't have the permission, even though the vip group has a higher weight.

This is normal - if a group is inherited through another group, the closer group (in this case default) is considered first, even if its weight is lower.

You can use this configuration option to change it the behaviour though, or just assign vip directly.

https://github.com/lucko/LuckPerms/blob/fe0e82f285401c5fedf2e3fc833149a6f7bed064/bukkit/src/main/resources/config.yml#L390-L401

But also seems you have your inheritance backwards.

If VIP is more important than default, it should probably be inheriting permissions from default, not the other way around.