Changeset - 4c4e1ec26e95
[Not reviewed]
default
0 1 0
Thomas De Schampheleire - 8 years ago 2018-05-16 21:19:56
thomas.de_schampheleire@nokia.com
auth: raise log level of 'permission denied' from DEBUG to INFO (issue #243)

Denying an access can be quite relevant to an administrator.
A log level of INFO is more reasonable than DEBUG.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/auth.py
Show inline comments
 
@@ -851,25 +851,25 @@ class _PermsDecorator(object):
 

	
 
    def __wrapper(self, func, *fargs, **fkwargs):
 
        cls = fargs[0]
 
        user = request.authuser
 
        log.debug('checking %s permissions %s for %s %s',
 
          self.__class__.__name__, self.required_perms, cls, user)
 

	
 
        if self.check_permissions(user):
 
            log.debug('Permission granted for %s %s', cls, user)
 
            return func(*fargs, **fkwargs)
 

	
 
        else:
 
            log.debug('Permission denied for %s %s', cls, user)
 
            log.info('Permission denied for %s %s', cls, user)
 
            if user.is_default_user:
 
                raise _redirect_to_login(_('You need to be signed in to view this page'))
 
            else:
 
                raise HTTPForbidden()
 

	
 
    def check_permissions(self, user):
 
        raise NotImplementedError()
 

	
 

	
 
class HasPermissionAnyDecorator(_PermsDecorator):
 
    """
 
    Checks the user has any of the given global permissions.
0 comments (0 inline, 0 general)