getPrefix/Suffix assume players always have a primary group
zml2008 opened this issue ยท 3 comments
So Essentials' permissions provider acts under the assumption that all players are always in at least one group. I'd guess this hasn't come up much because most permissions plugins implement default data as a group -- or at least in their default settings actually have every player in a default group.
When someone comes along with a setup where their player is not in a group (as they might when starting with a dev build of PEX2), the EssX assumption results in errors like https://pastebin.com/MYEpYXM9
VaultAPI's specification is unclear on whether getPrimaryGroup is actually allowed to return null, but giving a null result for a user with no data makes the most sense to me. I also don't see what sort of response requesting with a null group name would give -- so I'd like to see EssX only querying for a prefix/suffix if a player's primary group is not null.
As a side note, PEX doesn't need essentials emulating wildcard permissions and inheritance -- it shouldn't cause any problems, but does do more work than is necessary. at some point it might be useful to override some of the check methods in EssX's PEX resolver to not do that.
So effectively what you're suggesting is for getPrefix/getSuffix to return null if playerGroup == null?
I may be misunderstanding something, but is there any particular reason not to just have a default group, or a "no group" dummy group (returning an empty name/prefix/suffix) in PEX2? If most other permission plugins already do that it might lead to better compatibility with other existing plugins.