Commit 711265ea authored by Vincent Pelletier's avatar Vincent Pelletier

Add a missing import.

Add an explicit raise.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11894 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bd44ae7c
...@@ -20,12 +20,14 @@ from AccessControl import ClassSecurityInfo ...@@ -20,12 +20,14 @@ from AccessControl import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager,\ from AccessControl.SecurityManagement import getSecurityManager,\
setSecurityManager, newSecurityManager setSecurityManager, newSecurityManager
from Products.PageTemplates.PageTemplateFile import PageTemplateFile from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from Products.PluggableAuthService.PluggableAuthService import _SWALLOWABLE_PLUGIN_EXCEPTIONS
from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
from Products.PluggableAuthService.utils import classImplements from Products.PluggableAuthService.utils import classImplements
from Products.PluggableAuthService.interfaces.plugins import IAuthenticationPlugin from Products.PluggableAuthService.interfaces.plugins import IAuthenticationPlugin
from Products.PluggableAuthService.interfaces.plugins import IUserEnumerationPlugin from Products.PluggableAuthService.interfaces.plugins import IUserEnumerationPlugin
from Products.ERP5Type.Cache import CachingMethod from Products.ERP5Type.Cache import CachingMethod
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
import sys
from zLOG import LOG from zLOG import LOG
...@@ -182,6 +184,13 @@ class ERP5UserManager(BasePlugin): ...@@ -182,6 +184,13 @@ class ERP5UserManager(BasePlugin):
raise raise
except: except:
LOG('ERP5Security', 0, 'getUserByLogin failed', error=sys.exc_info()) LOG('ERP5Security', 0, 'getUserByLogin failed', error=sys.exc_info())
# Here we must raise an exception to prevent calers from caching
# a result of a degraded situation.
# The kind of exception does not matter as long as it's catched by
# PAS and causes a lookup using another plugin or user folder.
# As PAS does not define explicitely such exception, we must use
# the _SWALLOWABLE_PLUGIN_EXCEPTIONS list.
raise _SWALLOWABLE_PLUGIN_EXCEPTIONS[0]
finally: finally:
setSecurityManager(sm) setSecurityManager(sm)
return [item.getObject() for item in result] return [item.getObject() for item in result]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment