description = "List user permissions (list alias)")
public void userListAliasPermissions(PermissionsEx plugin, CommandSender sender, Map<String, String> args) {
String userName = this.autoCompletePlayerName(args.get("user"));
String worldName = this.autoCompleteWorldName(args.get("world"));
PermissionUser user = plugin.getPermissionsManager().getUser(userName);
if (user == null) {
sender.sendMessage(ChatColor.RED + "User \"" + userName + "\" doesn't exist.");
return;
}
userName = user.getName();
sender.sendMessage("'" + describeUser(user) + "' is a member of:");
printEntityInheritance(sender, user.getParents());
Map<String, List<PermissionGroup>> allParents = user.getAllParents();
for (String world : allParents.keySet()) {
if (world == null) {
continue;
}
sender.sendMessage(" @" + world + ":");
printEntityInheritance(sender, allParents.get(world));
}
sender.sendMessage(userName + "'s permissions:");
this.sendMessage(sender, this.mapPermissions(worldName, user, 0));
sender.sendMessage(userName + "'s options:");
for (Map.Entry<String, String> option : user.getOptions(worldName).entrySet()) {
sender.sendMessage(" " + option.getKey() + " = \"" + option.getValue() + "\"");
}
}