A federal judge has upheld a new state law allowing employees with concealed weapons permits to take guns to work and lock them in their cars but ruled that businesses can prohibit customers from taking guns on their property.