After years of machinations and stalled negotiations , legal pressure on the government intensified in 2004 , when a federal district judge in Sacramento , Lawrence K. Karlton , ruled in the environmentalists ' favor , saying the California Fish and Game Code , which guarantees water to fisheries , could be applied to the federally owned Friant Dam .