Web-based social networks (WBSNs) are today one of the hugest data source available on the Web and therefore data protection has become an urgent need. This has resulted in the proposals of some access control models for social networks. Quite all the models proposed so far enforce a relationship-based access control, where the granting of a resource depends on the relationships established in the network. An important issue is therefore to devise access control mechanisms able to enforce relationship-based access control by, at the same time, protecting relationships privacy. In this paper, we propose a solution to this problem, which enforces access control through a collaboration of selected nodes in the network. We exploit the ElGamal cryptosystem to preserve relationship privacy when relationship information is used for access control purposes.