The curtain is for separating the galley from the passenger cabin, nothing else. On types that have no galley up front, there typically is no such curtain between the passenger cabin and the cockpit door.
I understand that the curtain is mainly intended to keep all those kitchen fumes from pestering the passengers seated in the vicinity; any uses beyond that are merely coincidental.
Cockpit access and the associated regulations and procedures are another matter and will not be discussed by me here.