
Multiple "same" permission in different groups
Closed this issue ยท 7 comments
Previously I asked a question in the official plugin thread in spigot
The question is the same one I did there.
In my server I give temporal ranks, and when they finish they must return to an old rank (different in each case), therefore I can not do "set" or put it of primary group.
When a user has several similar permissions, he sometimes chooses the right one, sometimes not
I explain it a bit better in the official thread, the groups have the correct weight, I have tried to deny permissions from one group to another but none of this works
Sorry, I must've forgotten to reply to you on the thread.
I'm not sure why that's happening. Your description of the setup on the Spigot thread sounds spot on. I can't see why there would be an issue there.
My only guess is that towny is doing something silly with the lookups. The best way to diagnose this would be to use the verbose command.
https://github.com/lucko/LuckPerms/wiki/Verbose
This should hopefully let you see where things are going wrong.
https://gist.github.com/anonymous/07fa575b27ad61013ba031d616d88466
https://gist.github.com/anonymous/eb92e3278a77097966cb3997ab656298
For some reason he is not checking towny_maxplots in any time
At least not directly
Seems like Towny uses a players primary group, and ignores any other groups or permissions they may have.
So, you can't set the max plots meta value to the user directly. You have to set it to their primary group.
https://github.com/ElgarL/Towny/blob/master/src/com/palmergames/bukkit/towny/TownySettings.java#L1675
https://github.com/ElgarL/Towny/blob/master/src/com/palmergames/bukkit/towny/permissions/VaultPermSource.java#L70
If it cannot find a value via meta, it falls back to this method, which will just use the first value it finds...
https://github.com/ElgarL/Towny/blob/master/src/com/palmergames/bukkit/towny/permissions/TownyPermissionSource.java#L72
That's why you're getting strange results. It's not a LuckPerms issue, just crappy Towny design. :(
I'm looking into this, we weren't actually using getPrimaryGroup(), so it was acting the way you said it does. Can't help it if that part of towny was written before primary groups were a thing...
we weren't actually using getPrimaryGroup()
That's what that method does.
Can't help it if that part of towny was written before primary groups were a thing...
You're using the method for it? I don't understand what you're trying to say?
The sane way to handle this is to either return the max value found here:
https://github.com/ElgarL/Towny/blob/master/src/com/palmergames/bukkit/towny/permissions/TownyPermissionSource.java#L71
instead of just returning when the first result is found, or to use Chat#getPlayerInfoInteger
, and query the player, not their primary group.
Took care of it already, TownyAdvanced/Towny@11866ec
We were not using the preffered getPrimaryGroup(world, offlineplayer), instead just getPrimaryGroup(player) which your plugin doesn't defined in your vault section. SeDark tested this change and it works properly now.