From fdea454ca599a202a16dc396de1c664fc97009a0 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Mon, 12 Jun 2006 11:32:28 +0000
Subject: [PATCH] it is very important to take the user from the owner, if we
 take the current user logged in, then security definition will not be stable

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7696 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/ERP5Type.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/product/ERP5Type/ERP5Type.py b/product/ERP5Type/ERP5Type.py
index 7a04e383ab..6015de021c 100644
--- a/product/ERP5Type/ERP5Type.py
+++ b/product/ERP5Type/ERP5Type.py
@@ -273,6 +273,12 @@ class ERP5TypeInformation( FactoryTypeInformation, RoleProviderBase, Translation
       """
       #FIXME We should check the type of the acl_users folder instead of
       #      checking which product is installed.
+      if user_name is None:
+        # First try to guess from the owner
+        try:
+          user_name = object.getOwnerInfo()['id']
+        except AttributeError:
+          pass
       if user_name is None:
         if ERP5UserManager is not None:
           # We use id for roles in ERP5Security
-- 
2.30.9