From 367e9ac265dcd11f07f3f192e3f527a3ede84ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Fri, 17 Aug 2007 10:04:41 +0000 Subject: [PATCH] "if sm.getUser() != SUPER_USER" compares an user and an user id, it will always be false. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15723 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Security/ERP5UserManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/product/ERP5Security/ERP5UserManager.py b/product/ERP5Security/ERP5UserManager.py index f51842965d..74c4ff4498 100644 --- a/product/ERP5Security/ERP5UserManager.py +++ b/product/ERP5Security/ERP5UserManager.py @@ -179,7 +179,7 @@ class ERP5UserManager(BasePlugin): # because we aren't logged in, we have to create our own # SecurityManager to be able to access the Catalog sm = getSecurityManager() - if sm.getUser() != SUPER_USER: + if sm.getUser().getId() != SUPER_USER: newSecurityManager(self, self.getUser(SUPER_USER)) try: @@ -190,7 +190,7 @@ class ERP5UserManager(BasePlugin): raise except: LOG('ERP5Security', PROBLEM, 'getUserByLogin failed', error=sys.exc_info()) - # Here we must raise an exception to prevent calers from caching + # Here we must raise an exception to prevent callers 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. -- 2.30.9