When should it be legal to revive the deceased with AI?

This may be a slightly different post so I hope you will indulge me...
A recent post reads Robin Williams' Daughter Disgusted by Efforts to Bring her Dad Back with AI. It may be legal to do this, and it is technically feasible. But IMHO. There are times when we should let the dead rest in peace.  When, if ever, do you think it should be legal to revive the deceased with AI?