diff --git a/src/main/java/fr/xephi/authme/permission/PermissionsManager.java b/src/main/java/fr/xephi/authme/permission/PermissionsManager.java index 0dbfc52fc..89e012418 100644 --- a/src/main/java/fr/xephi/authme/permission/PermissionsManager.java +++ b/src/main/java/fr/xephi/authme/permission/PermissionsManager.java @@ -501,7 +501,7 @@ public class PermissionsManager { } /** - * Add the permission group of a player, if supported. + * Add the permission groups of a player, if supported. * * @param player The player * @param groupNames The name of the groups to add. @@ -583,6 +583,31 @@ public class PermissionsManager { } } + /** + * Remove the permission groups of a player, if supported. + * + * @param player The player + * @param groupNames The name of the groups to add. + * + * @return True if succeed, false otherwise. + * False is also returned if this feature isn't supported for the current permissions system. + */ + @SuppressWarnings({"unchecked", "rawtypes", "deprecation"}) + public boolean removeGroups(Player player, List groupNames) { + // If no permissions system is used, return false + if(!isEnabled()) + return false; + + // Add each group to the user + boolean result = true; + for(String groupName : groupNames) + if(!removeGroup(player, groupName)) + result = false; + + // Return the result + return result; + } + /** * Set the permission group of a player, if supported. *