User generated private IPFS that connects to a Public IPFS network under certain conditions

Is there a guide to build an application that let’s a user generate a private IPFS that only the user can access. However this private IPFS network can be accessed from a public IPFS network under ceratin conditions? The conditions are that the user and the smart contract generated by the user are the only entities that can access the files on the private IPFS network?

Probably the easiest way to do that would be a Web3 injection authentication system allowing access to a web server proxy-ed IPFS node running in private network configuration…