From bf89211cb0a5230dff623a8880117a161e029c2b Mon Sep 17 00:00:00 2001
From: Alexandre Boeglin <alex@nexedi.com>
Date: Tue, 22 May 2007 09:41:58 +0000
Subject: [PATCH] sm.getUser() returns a User object, we need to getId() on it
 before comparing with SUPER_USER

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14542 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Security/ERP5GroupManager.py | 2 +-
 product/ERP5Security/ERP5UserManager.py  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/product/ERP5Security/ERP5GroupManager.py b/product/ERP5Security/ERP5GroupManager.py
index f2159fe663..46827c071d 100644
--- a/product/ERP5Security/ERP5GroupManager.py
+++ b/product/ERP5Security/ERP5GroupManager.py
@@ -93,7 +93,7 @@ class ERP5GroupManager(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:
         # To get the complete list of groups, we try to call the
diff --git a/product/ERP5Security/ERP5UserManager.py b/product/ERP5Security/ERP5UserManager.py
index c1f33215a8..323ba75e17 100644
--- a/product/ERP5Security/ERP5UserManager.py
+++ b/product/ERP5Security/ERP5UserManager.py
@@ -96,7 +96,7 @@ class ERP5UserManager(BasePlugin):
             user = user_list[0]
 
             sm = getSecurityManager()
-            if sm.getUser() != SUPER_USER:
+            if sm.getUser().getId() != SUPER_USER:
               newSecurityManager(self, self.getUser(SUPER_USER))
             try:
               if pw_validate(user.getPassword(), password) and\
@@ -175,7 +175,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:
-- 
2.30.9