web/views/cwproperties.py
changeset 2181 94ca417b9b07
parent 2144 51c84d585456
parent 2161 200481e7b156
child 2234 1fbcf202882d
--- a/web/views/cwproperties.py	Tue Jun 23 13:36:38 2009 +0200
+++ b/web/views/cwproperties.py	Sat Jun 27 00:56:30 2009 +0200
@@ -14,7 +14,7 @@
 
 from cubicweb import UnknownProperty
 from cubicweb.selectors import (one_line_rset, none_rset, implements,
-                                match_user_groups)
+                                match_user_groups, objectify_selector)
 from cubicweb.view import StartupView
 from cubicweb.web import uicfg, stdmsgs
 from cubicweb.web.form import FormViewMixIn
@@ -218,8 +218,10 @@
         subform.form_add_hidden('pkey', key, eidparam=True)
         form.form_add_subform(subform)
         return subform
-    
-def is_user_prefs(cls, req, rset, row=None, col=0, **kwargs):
+
+
+@objectify_selector
+def is_user_prefs(cls, req, rset=None, row=None, col=0, **kwargs):
     return req.user.eid == rset[row or 0][col]
 
 
@@ -228,7 +230,7 @@
     __select__ = (
         # we don't want guests to be able to come here
         match_user_groups('users', 'managers') &
-        (none_rset() | ((one_line_rset() & is_user_prefs) &
+        (none_rset() | ((one_line_rset() & is_user_prefs()) &
                         (one_line_rset() & match_user_groups('managers'))))
         )