Changeset - e9fe4ff57cbb
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 15 years ago 2011-05-15 13:49:14
marcin@python-works.com
Do a redirect to login for anonymous users
1 file changed with 16 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/auth.py
Show inline comments
 
@@ -410,8 +410,22 @@ class PermsDecorator(object):
 

	
 
        else:
 
            log.warning('Permission denied for %s %s', cls, self.user)
 
            #redirect with forbidden ret code
 
            return abort(403)
 

	
 

	
 
            anonymous = self.user.username == 'default'
 

	
 
            if anonymous:
 
                p = url.current()
 

	
 
                import rhodecode.lib.helpers as h
 
                h.flash(_('You need to be a signed in to '
 
                          'view this page'),
 
                        category='warning')
 
                return redirect(url('login_home', came_from=p))
 

	
 
            else:
 
                #redirect with forbidden ret code
 
                return abort(403)
 

	
 
    def check_permissions(self):
 
        """Dummy function for overriding"""
0 comments (0 inline, 0 general)