entities/authobjs.py
branchstable
changeset 7120 e8b6fc55df2d
parent 7110 73b3e0e095d3
child 7370 96923d75610b
--- a/entities/authobjs.py	Mon Mar 28 16:41:36 2011 +0200
+++ b/entities/authobjs.py	Mon Mar 28 16:42:46 2011 +0200
@@ -1,4 +1,4 @@
-# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -87,8 +87,10 @@
                 'CWProperty X WHERE X pkey %(k)s, X for_user U, U eid %(u)s',
                 {'k': pkey, 'u': self.eid}).get_entity(0, 0)
         except:
-            self._cw.create_entity('CWProperty', pkey=unicode(pkey),
-                                   value=value, for_user=self)
+            kwargs = dict(pkey=unicode(pkey), value=value)
+            if self.is_in_group('managers'):
+                kwargs['for_user'] = self
+            self._cw.create_entity('CWProperty', **kwargs)
         else:
             prop.set_attributes(value=value)