hooks/security.py
changeset 8190 2a3c1b787688
parent 6426 541659c39f6a
child 8239 c6cdd060212e
--- a/hooks/security.py	Thu Feb 02 14:33:30 2012 +0100
+++ b/hooks/security.py	Mon Jan 23 13:25:02 2012 +0100
@@ -1,4 +1,4 @@
-# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -21,8 +21,9 @@
 
 __docformat__ = "restructuredtext en"
 
+from logilab.common.registry import objectify_predicate
+
 from cubicweb import Unauthorized
-from cubicweb.selectors import objectify_selector, lltrace
 from cubicweb.server import BEFORE_ADD_RELATIONS, ON_COMMIT_ADD_RELATIONS, hook
 
 
@@ -64,8 +65,7 @@
             rdef.check_perm(session, action, fromeid=eidfrom, toeid=eidto)
 
 
-@objectify_selector
-@lltrace
+@objectify_predicate
 def write_security_enabled(cls, req, **kwargs):
     if req is None or not req.write_security:
         return 0