I haven't done much in the way of authorization on a per-asset basis,
but just to remind you in case it helps:
- you can override Dragonfly responses with before_serve
http://markevans.github.com/dragonfly/file.URLs.html#Overriding_responses
e.g.
app.configure do |c|
c.server.before_serve do |job, env|
# inspect env for correct auth and set unauthorized
# ....
if unauthorized
throw :halt, [401, {'Content-type' => 'text/plain'},
['unauthorized']]
end
end
end
- also, the dragonfly server is just Rack, so you could add some
custom Rack middleware in front of it for authorization
On Oct 23, 11:31 pm, Bruno Almeida <
brunomonteiroalme...@gmail.com>
wrote:
> Hi,
>
> I knew a solution, on paperclip way:
http://everydayrails.com/2010/07/08/authenticated-attachments-papercl...