User should only have access to one file

I use nextcloud 15 with docker.

I recently created a new user, lets say his name ist ‘X’. X should only have access (read and write) to one specific file in my root folder, but not the root itselfs. How is this possible?

What do you exactly understand under “root folder”? Do you mean your Nextcloud web root or are you speaking about a root directory on your server, etc.?

Usually you can press the share button grafik behind a file to share it with another user.