LuckPerms

LuckPerms

41.4k Downloads

Permissions getting cleared too early in PlayerQuitEvent

chrisliebaer opened this issue ยท 1 comments

commented

Right now, permissions on Bukkit are cleared in the PlayerQuitEvent with the priority Monitor. However this causes permission checks to fail if other plugins rely on the permission system being active while also using MONITOR priority. Even worse: Depending on the order of event handler registration, the issues caused by this behavior is not deterministic and might disappear after a restart or change of server configuration. Given that permissions are a very basic feature, I don't think this intended behavior.

Relevant line in source: https://github.com/lucko/LuckPerms/blob/master/bukkit/src/main/java/me/lucko/luckperms/bukkit/listeners/BukkitConnectionListener.java#L187

Suggested solution: Execute permission clear in next tick to ensure that event handler have working permissions when running with MONITOR priority.

Potential issues: What happens if player reconnects betwenn disconnect and next tick? Permissions shouldn't be cleared in this case. I don't know the architecture of LP enough to answer if this would become an issue.

commented

Thanks for the suggestion :)