In a wide 3-quart (3-L) saucepan, heat the oil over medium-high heat. When it shimmers, add the scallion whites and garlic and cook, stirring, for 2 minutes. Add the allspice and rice and stir for 30 seconds. Stir in the coconut milk, 2½ cups (600 ml) water, ½ teaspoon salt, and several grindings of pepper. Bring to a boil, then lower the heat and simmer, stirring occasionally, until most of the liquid is evaporated and absorbed, about 25 minutes.
Pile the beans and scallion greens on top, drizzle in another ½ cup (120 ml) water, cover, and cook until the rice is tender and almost all the liquid is absorbed, about 10 minutes. Stir gently to fold in the beans, season with more salt, if needed, and serve.