Added group support check to setGroups method in Utils class

This commit is contained in:
Tim Visée 2015-11-21 16:08:41 +01:00
parent eaba2765fa
commit 6dc4066563

View File

@ -129,14 +129,16 @@ public class Utils {
if(!Settings.isPermissionCheckEnabled)
return;
// TODO: Make sure a groups system is used!
// Get the permissions manager, and make sure it's valid
PermissionsManager permsMan = plugin.getPermissionsManager();
if(permsMan == null)
ConsoleLogger.showError("Failed to access permissions manager instance, shutting down.");
assert permsMan != null;
// Make sure group support is available
if(!permsMan.hasGroupSupport())
ConsoleLogger.showError("The current permissions system doesn't have group support, unable to set group!");
switch(group) {
case UNREGISTERED:
// Remove the other group type groups, set the current group