Here's the opinion, which concludes that the ban on S.F. residents' possessing handguns — and on sales and other transfers of all guns and ammunition within the city — is preempted by state law (thanks to Matt Rustler at Stop The Bleating for uploading the file).
I'm not sure I'd endorse all the details of the court's reasoning, and I'm not an expert on the ins and outs of California state/local preemption law. But I did want to make a few observations:
California Penal Code § 12026(b) quite explicitly says:
No permit or license to purchase, own, possess, keep, or carry, either openly or concealed, shall be required of any citizen of the United States or legal resident over the age of 18 years who resides or is temporarily within this state, and who is not within the excepted classes prescribed by Section 12021 or 12021.1 of this code or Section 8100 or 8103 of the Welfare and Institutions Code, to purchase, own, possess, keep, or carry, either openly or concealed, a pistol, revolver, or other firearm capable of being concealed upon the person within the citizen's or legal resident's place of residence, place of business, or on private property owned or lawfully possessed by the citizen or legal resident.
This pretty clearly bars any California government entity (including cities and counties) from requiring licenses to buy or possess handguns. And it seems to me that if California government entities may not demand licenses or permits for an activity, they may not forbid it outright, either.
This is yet another reminder to be skeptical of claims that "no one is seriously proposing to ban or confiscate all guns. You hear that only from the gun lobby itself, which whistles up this bogeyman whenever some reasonable regulation is proposed." San Francisco voters categorically banned possession of handguns by city residents (except police officers, security guards, and the like), and categorically banned sales of all firearms. While San Franciscans would remain free to buy rifles or shotguns in neighboring cities, presumably those who advocate for such gun sales bans would endorse the broadening of the bans — if gun sales bans are indeed good for San Francisco, I take it that they would be good for Berkeley, Oakland, San Mateo, and Marin, too.
Finally, the ordinance is another reminder of how gun controls routinely favor those who can hire others to guard them, yet restrict those who want to guard themselves or their family members. "[S]ecurity guards, regularly employed and compensated by a person engaged in any lawful business, while actually employed and engaged in protecting and preserving property or life within the scope of his or her employment, may also possess handguns." The celebrity, big businessman, or relatively prosperous store owner may defend himself by hiring a guard. The woman who wants to protect herself against rapists, the parent who wants to protect his family against home invaders, or the small businessman who wants to be his own security guard — because he can't afford to hire someone else — is out of luck. (Nor can one justify this on the theory that security guards are trained professional; they're in fact generally not terribly well trained, and in any event a person who wants to defend himself, his family, and his business is not allowed to have a handgun to do so no matter how much training he gets.)
In any case, I'm glad the ordinance was struck down, and I hope the decision will be affirmed on appeal. Congratulations to my acquaintance Chuck Michel for winning this one.
UPDATE: I originally erroneously paraphrased § 12026 as "bar[ring] any California government entity ... from requiring licenses to buy or possess guns" (rather than "handguns"); thanks to commenter Christopher Cooke for correcting me.