![See my diagram here](https://i.stack.imgur.com/0L7rj.png)

I have the following problem: A customer can have 2 type of resources: servers and domains. A server can serve multiple domains and a domain can be allocated to multiple servers but a customer has a fixed set of servers and domains allocated to him. The customer can edit the domain-server-mapping table directly. How can I prevent the customer from allocating servers which do not belong to him, in other words how can I make sure that a domain and server inserted in domain-server-mapping have the same customer primary key?