Added some missing support for Nijikokun's Permissions in permissions manager

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

View File

@ -1,5 +1,6 @@
package fr.xephi.authme.permission;
import com.nijiko.permissions.Group;
import com.nijiko.permissions.PermissionHandler;
import com.nijikokun.bukkit.Permissions.Permissions;
import de.bananaco.bpermissions.api.ApiLayer;
@ -466,6 +467,18 @@ public class PermissionsManager {
// Vault
return Arrays.asList(vaultPerms.getPlayerGroups(player));
case PERMISSIONS:
// Permissions
// Create a list to put the groups in
List<String> groups = new ArrayList<>();
// Get the groups and add each to the list
for(Group group : this.defaultPerms.getGroups(player.getName()))
groups.add(group.getName());
// Return the groups
return groups;
case NONE:
// Not hooked into any permissions system, return an empty list
return new ArrayList<>();
@ -520,6 +533,10 @@ public class PermissionsManager {
// Vault
return vaultPerms.playerInGroup(player, groupName);
case PERMISSIONS:
// Permissions
return this.defaultPerms.inGroup(player.getWorld().getName(), player.getName(), groupName);
case NONE:
// Not hooked into any permissions system, return an empty list
return false;
@ -578,6 +595,11 @@ public class PermissionsManager {
vaultPerms.playerAddGroup(player, groupName);
return true;
case PERMISSIONS:
// Permissions
// FIXME: Add this method!
//return this.defaultPerms.group
case NONE:
// Not hooked into any permissions system, return false
return false;
@ -661,6 +683,11 @@ public class PermissionsManager {
vaultPerms.playerRemoveGroup(player, groupName);
return true;
case PERMISSIONS:
// Permissions
// FIXME: Add this method!
//return this.defaultPerms.group
case NONE:
// Not hooked into any permissions system, return false
return false;
@ -752,6 +779,11 @@ public class PermissionsManager {
vaultPerms.playerAddGroup(player, groupName);
return true;
case PERMISSIONS:
// Permissions
// FIXME: Add this method!
//return this.defaultPerms.group
case NONE:
// Not hooked into any permissions system, return false
return false;