It's been done before with no success. If I remember correctly, the overlying problems were:
-access to the gun wasn't quick.
-fingerprint scans weren't reliable causing the weapon to lock out the intended user.
-when the batteries ran out or failed, the system defaulted to safe making the gun unusable until batteries were replaced.
-unit was easily bypassed if someone decided to steal the gun.
-unit could not be submerged or would default to safe.
-cost of unit was prohibitively expensive.
With all these problems it was better to just use a locked safe. There are also a number of guns that use a key lock directly on the gun. This feature also proves to be unpopular.