Merge branch 'master' of github.com:MilkBowl/Vault

This commit is contained in:
Morgan 2011-07-18 12:35:28 -04:00
commit 4ad44bb1c1
3 changed files with 303 additions and 273 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,16 @@ 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) {
if (PermissionsEx.getPermissionManager().getUser(playerName).getGroupsNames().length > 0)
return PermissionsEx.getPermissionManager().getUser(playerName).getGroupsNames()[0];
else
return null;
}
}