log 'Unauthorized' warning
This commit is contained in:
parent
24cd81e267
commit
0915d04e30
1 changed files with 6 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013 Helmut Merz helmutm@cy55.de
|
# Copyright (c) 2016 Helmut Merz helmutm@cy55.de
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -23,6 +23,7 @@ Common base class for loops browser view classes.
|
||||||
from cgi import parse_qs, parse_qsl
|
from cgi import parse_qs, parse_qsl
|
||||||
#import mimetypes # use more specific assignments from cybertools.text
|
#import mimetypes # use more specific assignments from cybertools.text
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from logging import getLogger
|
||||||
import re
|
import re
|
||||||
from time import strptime
|
from time import strptime
|
||||||
from urllib import urlencode
|
from urllib import urlencode
|
||||||
|
@ -149,6 +150,10 @@ class BaseView(GenericView, I18NView):
|
||||||
self.context = removeSecurityProxy(context)
|
self.context = removeSecurityProxy(context)
|
||||||
try:
|
try:
|
||||||
if not self.checkPermissions():
|
if not self.checkPermissions():
|
||||||
|
logger = getLogger('loops.browser.common-153')
|
||||||
|
principal = request.principal and request.principal.id
|
||||||
|
msg = 'Unauthorized: %s, %s' % (self.contextInfo, principal)
|
||||||
|
logger.warn(msg)
|
||||||
raise Unauthorized(str(self.contextInfo))
|
raise Unauthorized(str(self.contextInfo))
|
||||||
except ForbiddenAttribute: # ignore when testing
|
except ForbiddenAttribute: # ignore when testing
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Add table
Reference in a new issue