All user-generated media files are stored in GridFS. Currently I need to implement some kind of access-system, based on permissions for files GridFS.
For example, we have file in GridFS, called "passwords.txt", and only users, that have permission "allowed_to_download_passwords", can actually get access to that file.
What I have found is using http://wiki.nginx.org/XSendfile with Django view, that will check permissions and return correct response for nginx. It works with file-system media storage, but how can I implement that with GridFS? I already have seen nginx-gridfs, but seems, like it is too old and unmaintainable...
Are there any other options, that can be used in production?