LuckPerms

LuckPerms

41.4k Downloads

[Sponge] getOption on a group subject not always returning correct value.

dualspiral opened this issue ยท 0 comments

commented

Came across a weird issue where if I request an option/meta from a group that has meta directly on it, as well as on parent groups, the parent group sometimes take precidence.

I used this code to create the command /testoption [group] [option] to test what a permission plugin will return to me. In this case, I expected the moderator group to return 9 for my option, but it returned 5.

> lp group moderator meta info
[19:02:48] [Server thread/INFO] [nucleus]: Server ran the command: /lp group moderator meta info
[19:02:48] [pool-3-thread-1/INFO]: [LP] moderator has no prefixes.
[19:02:48] [pool-3-thread-1/INFO]: [LP] moderator has no suffixes.
[19:02:48] [pool-3-thread-1/INFO]: [LP] moderator's Meta
[19:02:48] [pool-3-thread-1/INFO]: [LP] -> mod = "[Helper]" (inherited from helper)
[19:02:48] [pool-3-thread-1/INFO]: [LP] -> mod = "[Mod]" (inherited from self)
[19:02:48] [pool-3-thread-1/INFO]: [LP] -> mod = "[Deputy]" (inherited from deputymoderator)
[19:02:48] [pool-3-thread-1/INFO]: [LP] -> nucleus.list.weight = "5" (inherited from helper)
[19:02:48] [pool-3-thread-1/INFO]: [LP] -> nucleus.list.weight = "9" (inherited from self)
> testoption moderator nucleus.list.weight
[19:02:51] [Server thread/INFO] [nucleus]: Server ran the command: /testoption moderator nucleus.list.weight
[19:02:51] [Server thread/INFO]: moderator - Optional[5]

It seems to me that self is not getting included in permission option checks. I would expect meta directly on a group should always be returned above a parent group.