Added getGroups and getPrimaryGroup

This commit is contained in:
Sleaker 2011-07-08 09:26:20 -07:00
parent 389f5c3b6b
commit 027a493fc7
3 changed files with 27 additions and 0 deletions

View File

@ -276,4 +276,13 @@ public interface Permission {
*/
public void setGroupInfoString(String world, String groupName, String node, String value);
/**
* Gets the list of groups that this player has
*
* @param world Name of World
* @param playerName Name of Player
*/
public String[] getPlayerGroups(String world, String playerName);
public String getPrimaryGroup(String world, String playerName);
}

View File

@ -338,4 +338,13 @@ public class Permission_Permissions implements Permission {
return false;
}
}
@Override
public String[] getPlayerGroups(String world, String playerName) {
return this.permission.getHandler().getGroups(world, playerName);
}
public String getPrimaryGroup(String world, String playerName) {
return this.permission.getHandler().getPrimaryGroup(world, playerName);
}
}

View File

@ -348,4 +348,13 @@ public class Permission_PermissionsEx implements Permission {
}
}
@Override
public String[] getPlayerGroups(String world, String playerName) {
return PermissionsEx.getPermissionManager().getUser(playerName).getGroupsNames();
}
@Override
public String getPrimaryGroup(String world, String playerName) {
return PermissionsEx.getPermissionManager().getUser(playerName).getGroupsNames()[0];
}
}