Allow specific users to see specific files - Django

I’m building a system to manage documents using Django, so I want to allow specific users (based on their ID o email) to read specific documents (uploaded by the same user or shared with another one specified by the file creator). How can I build this feature?

If that’s all you want to do - limit the ability to access data based upon their ID, you can implement that in your views.
In your list view, you can filter by some criteria. In your download, you can verify the file id in the url before serving the file.