Code of Civil Procedure CCP § 415.21
(a) Notwithstanding any other law, any person shall be granted access to a gated community for a reasonable period of time for the sole purpose of performing lawful service of process or service of a subpoena upon displaying a current driver’s license or other identification, and one of the following:
(1) A badge or other confirmation that the individual is acting in his or her capacity as a representative of a county sheriff or marshal, or as an investigator employed by an office of the Attorney General, a county counsel, a city attorney, a district attorney, or a public defender.
(2) Evidence of current registration as a process server pursuant to Chapter 16 (commencing with Section 22350 ) of Division 8 of the Business and Professions Code or of licensure as a private investigator pursuant to Chapter 11.3 (commencing with Section 7512 ) of Division 3 of the Business and Professions Code.
(b) This section shall only apply to a gated community that is staffed at the time service of process is attempted by a guard or other security personnel assigned to control access to the community.