Rinse the beans and drain. Add to a saucepan with 1 litre of water and bring to the boil. Boil for 10 minutes, then reduce the heat and simmer for 20 minutes. Drain in a colander and give the beans a quick rinse.
Meanwhile fry the onions for 5 minutes. Then add the tomatoes, cumin, garlic granules, salt and vegetable stock. Bring to the boil, then reduce the heat and cover with the lid. Add the partially cooked drained beans after 20 minutes and continue to simmer for another 25 minutes.
Rinse the basmati rice using several changes of water and until the water runs clear. Add the rice, 1 and a 1/2 tins of coconut milk, water, sugar and salt to a saucepan.
Bring to a light boil and stir well to ensure no rice is sticking to the bottom of the pan. Then reduce the heat to its lowest setting, bringing the rice to a simmer. Cover with the lid and simmer for 13 minutes and all the liquid has been absorbed. Turn off the heat and leave to rest for 5 minutes.
Lightly toast the desiccated coconut in a frying pan for 3 minutes until golden brown and fragrant. Fluff up the rice with a fork, serve and scatter over the desiccated coconut. Serve alongside the pinto beans.