Static files are served by a middleware in the WSGI chain,
this runs before the authentication layer got in, so it doesn't have
any knowledge of users.

You can roll your own statics serving controller which checks users
and so on, a minima solution can be:

class StaticsController(TGController):
    @expose()
    def _lookup(self, *args):
        return WSGIAppController(StaticURLParser(statics_path)), args

On Mon, Jun 18, 2012 at 2:39 PM, abc_coder <[email protected]> wrote:
> Hi all
>
> I searched a lot but haven’t found any solution. How can I in turgobears 2
> restrict access to static files only for logged users?
> I want add some protection from unlogged users and web robots.
>
> Please help.
>
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/turbogears/-/a6oOER4Ps3cJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to