PermissionsBukkit integration bug: getPlayerGroups(-)
Opened this issue ยท 3 comments
Permission_PermissionsBukkit.java, getPlayerGroups(String, String):
The function does not return player groups that are world-global, it only returns groups that have world-specific nodes in them. The function call that does not specify a world gets redirected to the one that does, filling it in via player.getWorld().getName().
Workaround is to introduce a per-world node for every world you wish to fix it for, for it to show up in the returned list, but this is a bug nonetheless.
Plugins like LWC break on this.
After this time actually reading the JavaDoc while debugging, this appears to be clearly stated in the abstract Permission class. So, technically, LWC and other plugins are at fault. Leaving the issue open though.
If a plugin needs to check global groups they should pass null. this is clearly noted in the API reference.
I find this very confusing. I want the groups the player is currently in, I don't care about if it is a world or global group. So I have to call the function twice - once with null and once with the world the Player is currently in and merge both arrays?
But May return odd values if the servers registered permission system does not have a global permission store.
and
May return unexpected results if you are looking for global groups, or if the registered permission system does not support world-specific groups.
So I can check at least somehow, if the permission system supports world specific or global rules? So I know which method to call and maybe merge both results? Otherwise I have to live with odd values, whatever this means...
Or do I have to add permission system dependand code for this? (Which I thought I don't need, when using vault)