#761 Restore permission group in sync with limbo players

- Couple AuthGroupHandler closer to the LimboService: whenever a limbo player is restored, the auth group should be restored as well. This fixes some consistency issues.
- Move AuthGroupHandler into limbo package and make it package-private
- Change permission handler to skip any empty groups (prevents odd command output e.g. for BukkitPermissions)
This commit is contained in:
ljacqu
2017-04-29 22:37:34 +02:00
parent d4c1370da6
commit e0e4cd112d
15 changed files with 47 additions and 104 deletions
@@ -3,8 +3,6 @@ package fr.xephi.authme.service;
import ch.jalu.configme.properties.Property;
import fr.xephi.authme.message.MessageKey;
import fr.xephi.authme.message.Messages;
import fr.xephi.authme.permission.AuthGroupHandler;
import fr.xephi.authme.permission.AuthGroupType;
import fr.xephi.authme.permission.PermissionNode;
import fr.xephi.authme.permission.PermissionsManager;
import fr.xephi.authme.settings.Settings;
@@ -27,9 +25,6 @@ public class CommonService {
@Inject
private PermissionsManager permissionsManager;
@Inject
private AuthGroupHandler authGroupHandler;
CommonService() {
}
@@ -85,16 +80,4 @@ public class CommonService {
public boolean hasPermission(Player player, PermissionNode node) {
return permissionsManager.hasPermission(player, node);
}
/**
* Sets the permission group of the given player.
*
* @param player the player to process
* @param group the group to add the player to
*/
// TODO ljacqu 20170304: Move this out of CommonService
public void setGroup(Player player, AuthGroupType group) {
authGroupHandler.setGroup(player, group);
}
}