The safest way is with patient-controlled analgesia, which administers a preset dose with a lock-out time. There are various types, electronic programmable pumps , which can administer the narcotic either automatically, as set by the anaesthesia provider, or manually, by the patient; and there are manual pumps such as the Viking Medical or Vygon pump.
Without the PCA pump, the anaesthetists usually give a loading dose in OR, bring the syringe to PACU and hand it to the RN taking the patient with instructions regarding the frequency and dosage. Normally it's something like 1-2mg Morphine at 5 minute intervals as required. On discharge from PACU any remaining substance is discarded in view of a witness. In such circumstances it's a matter of trust; after all, there's nothing stopping RN and witness from sharing it out between themselves
Except ethics, of course.
I admit, I don't know of any specific study material governing this, other than regulations concerning the control of scheduled substances. You might find more help in that regard from the CRNAs.