Heat the oil in a large frying pan and gently fry the onion, pepper and sweet potato or carrots until softened but not browned.
Add the green beans, baked beans, corn and their liquid, tomato paste and barbecue spice seasoning. Bring to a boil, then simmer for 5 minutes.
Transfer to an ovenproof casserole. Sprinkle cheese over the top.
Cover the vegetable and cheese mixture with the sliced potatoes, brush with butter, season with salt and pepper and bake for 30 to 40 minutes until golden brown on top and the potatoes are cooked.