The answer is yes generally speaking. What we believe to be the applicable code sections follow for you to determine for yourself if this answer applies in your circumstance as this site does not provide legal advice.
Here are the California and U.S. sections:
--> PC 626.9Cal PC 626.9 reads: a) This section shall be known, and may be cited, as the Gun-Free School Zone Act of 1995.
(b) Any person who possesses a firearm in a place that the person knows, or reasonably should know, is a school zone, as defined in paragraph (1) of subdivision (e), unless it is with the written permission of the school district superintendent, his or her designee, or equivalent school authority, shall be punished as specified in subdivision (f).
(c) Subdivision (b) does not apply to the possession of a firearm under any of the following circumstances: [...]
(4) When the person is exempt from the prohibition against carrying a concealed firearm pursuant to subdivision (b), (d), (e), or (h) of Section 12027.[...]
(l) This section does not apply to a duly appointed peace officer as defined in Chapter 4.5 (commencing with Section 830) of Title 3 of Part 2, a full-time paid peace officer of another state or the federal government who is carrying out official duties while in California, any person summoned by any of these officers to assist in making arrests or preserving the peace while he or she is actually engaged in assisting the officer, a member of the military forces of this state or of the United States who is engaged in the performance of his or her duties, a person holding a valid license to carry the firearm pursuant to Article 3 (commencing with Section 12050) of Chapter 1 of Title 2 of Part 4, or an armored vehicle guard, engaged in the performance of his or her duties, as defined in subdivision (e) of Section 7521 of the Business and Professions Code.[...]
And
--> USC TITLE 18 PART I CHAPTER 44 § 922
USC 18 I 44 922 reads:
(q)(2)
(A) It shall be unlawful for any individual knowingly to possess a firearm that has moved in or that otherwise affects interstate or foreign commerce at a place that the individual knows, or has reasonable cause to believe, is a school zone.
(B) Subparagraph (A) does not apply to the possession of a firearm--
(ii) if the individual possessing the firearm is licensed to do so by the State in which the school zone is located or a political subdivision of the State, and the law of the State or political subdivision requires that, before an individual obtains such a license, the law enforcement authorities of the State or political subdivision verify that the individual is qualified under law to receive the license;
[OR -- if you don't have a CCW]
(iii) that is--
(I) not loaded; and
(II) in a locked container, or a locked firearms rack that is on a motor vehicle;[...]
However, if you're a student, you should comply with the school's regulations regarding weapons on campus -- the school administration can take action against you for violating their regs.
You should also check your license to see if there are any such restrictions placed on it by the issuing authority. You may be legal or not as far as State/Fedaral laws are concerned if you DO have a restriction on it, but you'd certainly have your license revoked if you break any of the restrictions placed on it.
Courtesy of SWDR