Make #getPlayerGroups return global too

This commit is contained in:
Luck 2016-08-29 21:35:11 +01:00
parent 3c83c578eb
commit 659baaf5fb
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 2 additions and 2 deletions

View File

@ -195,7 +195,7 @@ public class VaultPermissionHook extends Permission {
public String[] getPlayerGroups(String world, @NonNull String player) { public String[] getPlayerGroups(String world, @NonNull String player) {
final User user = plugin.getUserManager().get(player); final User user = plugin.getUserManager().get(player);
return (user == null) ? new String[0] : return (user == null) ? new String[0] :
world != null && !world.equals("") ? user.getLocalGroups("global", world).toArray(new String[0]) : world != null && !world.equals("") ? user.getGroups("global", world, true).toArray(new String[0]) :
user.getGroupNames().toArray(new String[0]); user.getGroupNames().toArray(new String[0]);
} }

View File

@ -325,7 +325,7 @@ public abstract class User extends PermissionHolder implements Identifiable<UUID
* @param includeGlobal Whether to include global groups * @param includeGlobal Whether to include global groups
* @return a {@link List} of group names * @return a {@link List} of group names
*/ */
private List<String> getGroups(String server, String world, boolean includeGlobal) { public List<String> getGroups(String server, String world, boolean includeGlobal) {
// Call super #getPermissions method, and just sort through those // Call super #getPermissions method, and just sort through those
Map<String, Boolean> perms = exportNodes(server, world, null, includeGlobal, true, null); Map<String, Boolean> perms = exportNodes(server, world, null, includeGlobal, true, null);
return perms.keySet().stream() return perms.keySet().stream()