1Soak 2 cups basmati rice in cold salted water for several hours.
2Season 8 boneless, skinless chicken thighs with salt and pepper. In a large frying pan, fry 2 thinly sliced onions in 1 tablespoon butter until lightly colored. Remove onions from pan and reserve. Add 1 more tablespoon butter and sprinkle the chicken with 1 teaspoon turmeric. Brown the chicken gently on both sides. Add 1 cup water and simmer, uncovered, for 20 minutes, or until the chicken is tender and the liquid is syrupy.
3Remove the chicken from the pot and cool, separately reserving the cooking liquid and onions.
4Soak 1/2 teaspoon saffron in a little milk until brightly colored, then whisk in 1/2 cup plain yogurt, 1 egg, and the chicken meat. Set aside.
5Wash 2 ounces barberries well, drain, and cook in a small pan with 2 tablespoons butter and 1 tablespoon sugar for several minutes, stirring, or until plump.
6Drain the soaked rice and rinse under cold water. Bring 6 cups salted water to a boil, add the rice, and cook for 5 minutes. Drain and rinse with cold water.
7Preheat the oven to 300°F. Brush a large casserole with 2 tablespoons butter and spread in half the rice. Arrange the chicken mixture over the rice. Combine the barberry mixture with the remaining rice and spread over the chicken. Spoon the reserved onions with liquid over the rice. Cover tightly and bake for 1 hour, or until the rice is fluffy. Remove from oven. Rest the casserole for 15 minutes before serving.