It is fair to say that drug use was very common in the Navy in the 1970s. The only way to nail someone for drug use then was to catch them possessing drugs. Normally, that happened when some idiot was smoking grass in a place where the odor was detected.
Ventilation fan rooms were a common place to smoke weed, but some fools did not bother to check to see where the fan output went. One classic case was a sailor who was smoking pot in a fanroom which fed air to the Captain's cabin. One sailor made sure that the fanroom he used exhausted to the outside of the ship; it was his bad luck that the exhaust outlet was over a refueling station and the ship was refueling alongside an AO at the time, bathing the ensign in charge of the refueling station, the BM1 who was really in change, and the twenty or so linehandlers with the sweet smell of pot smoke.
One funny one was when two sailors were smoking pot in the ship's vehicle; the next user was the ship's master-at-arms, who then obtained the permission of the Command Duty Officer to search the two sailors and their lockers. Another one was when two signalmen, one on each ship, made a deal for some hash by using semaphore signals; they didn't know that an officer on one of the ships, who could read semaphore, read the conversation. The purchasing sailor was met at the quarterdeck by the master-at-arms.
Court-martials on smaller ships were a real pain in the ass to conduct. They could only be held in port and they were a major drain on the ship as it took a considerable amount of time to go from beginning to end. As a result, most disciplinary problems were handled at Captain's Mast, otherwise known as Non-Judicial Punishment, or NJP. The most that could be done at Captain's Mast was to reduce a sailor by one paygrade, a maximum fine of half a month's pay for two months, and confinement.
Confinement options ranged from a maximum of three days in the brig on bread and water or thirty days in the brig or 45 days restriction to the ship with 45 days of extra duty. Hardly anyone was sent to the brig for other than the three days of bread and water and that was only done when those in the sailor's chain of command thought that he was still reachable. Otherwise, restriction to the ship was awarded, for that that way, the miscreant was still available for duty. Extra duty often tended to involve chipping paint and painting either the weatherdecks or the bilges in the enginerooms and firerooms.
The problem was that once a sailor decided that he liked to smoke pot, you might end up catching him once or twice a year, if that. The hard-core stoners just put up with the punishment, even if it meant that they were sent for repeated cranking tours, for they had no intention of re-enlisting, they lived on the ship and they simply didn't care.
In the early `80s, it all changed. The Navy instituted mandatory urine testing, which was soon nicknamed Operation Golden Flow. Once a year, everyone in the command was urine-tested, including all of the officers. Every so often, maybe once a month or once a quarter, the XO rolled a ten-sided die; everyone whose social security number ended in that digit was immediately mustered for a random piss test. Those who had security duties or high security clearances were subject to an additional piss test each year. The urine sampling was witnessed in order to combat cheating.
For officers and chief petty officers, failing a piss test was grounds for discharge. Petty officers, non-rated seamen and strikers were on a "two strikes" system. Some sailors appealed the discharge order and they were then brought before an administrative discharge review board made of three officers, normally headed by a lieutenant commander. The command was represented by a junior officer, the only attorney present was provided to the accused. Most of the boards took their duties seriously and some sailors did prevail, but the vast majority had their discharge orders confirmed and they were thrown out.
The result was, over time, drug usage in the Navy was greatly reduced. There were a lot fewer NJPs (and fewer extra-duty men available for dirty jobs).
6 hours ago