mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-08-31 09:39:36 +02:00
Created removeGroups method in permissions manager
This commit is contained in:
parent
bcf4eeab00
commit
462a2e9878
|
@ -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<String> 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.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user