In assuming the diodes to be ideal,
1
D1 is forward biased and D2 is reverse biased and hence current flows from A to B
2
D2 is forward biased and D1 is reverse biased and hence no current flows from B to A and vice versa.
3
D1 and D2 are both forward biased and hence current flows from A to B.
4
D1 and D2 are both reverse biased and hence no current flows from A to B and vice versa.