taigaio/taiga-back — pull request #55 by ikame (2014-07-04 10:26:20+00:00)
Title: Check permissions when accessing attachments

Attachment files dispatching is now done through `RawAttachmentView`
view that checks for appropiate permissions.

When using the development server this view just redirects to the real
media path of the file.

When using the production server the special redirection header
`X-Accel-Redirect` is used instead to improve efficiency by instructing
the server to dispatch the file instead of django, but you also need the
following configuration (Nginx):

```nginx
location /attachment-files {
internal;
alias /path/to/taiga/media/attachment-files;
}
```

It's recommended to also restrict the direct access from outside to the
`attachment-files` directory by using some configuration like this:

```nginx
location /media/attachment-files {
deny all;
}
```