private void calculateAttachment(Player player, World world) {
		Map<String, PermissionAttachment> attachments = permissions
				.get(player);

		PermissionAttachment attachment = attachments.get("group");
		Map<String, Map<String, Boolean>> playerPermissions = dataProvider
				.getPlayerPermissions(player.getName(), world.getName(), false);
		Map<String, Boolean> perms = playerPermissions.get("group");
		if (perms != null) {
			for (String entry : perms.keySet()) {
				attachment.setPermission(entry, perms.get(entry));
				logger.fine("[DroxPerms] Setting " + entry
						+ " to " + perms.get(entry) + " for player " + player.getName());
			}
		}
		attachment = attachments.get("subgroups");
		perms = playerPermissions.get("subgroups");
		if (perms != null) {
			for (String entry : perms.keySet()) {
				attachment.setPermission(entry, perms.get(entry));
				logger.fine("[DroxPerms] Setting " + entry
						+ " to " + perms.get(entry) + " for player " + player.getName());
			}
		}
		attachment = attachments.get("global");
		perms = playerPermissions.get("global");
		if (perms != null) {
			for (String entry : perms.keySet()) {
				attachment.setPermission(entry, perms.get(entry));
				logger.fine("[DroxPerms] Setting " + entry
						+ " to " + perms.get(entry) + " for player " + player.getName());
			}
		}

		attachment = attachments.get("world");
		perms = playerPermissions.get("world");
		if (perms != null) {
			for (String entry : perms.keySet()) {
				attachment.setPermission(entry, perms.get(entry));
				logger.fine("[DroxPerms] Setting " + entry
						+ " to " + perms.get(entry) + " for player " + player.getName());
			}
		}
		player.recalculatePermissions();
	}