server/session.py
branchstable
changeset 4987 ec93dd82c83f
parent 4924 d2fc161bee3f
child 4992 398cc8b39aec
--- a/server/session.py	Wed Mar 24 10:23:57 2010 +0100
+++ b/server/session.py	Wed Mar 24 11:00:02 2010 +0100
@@ -885,13 +885,15 @@
 
     # deprecated ###############################################################
 
-    @deprecated("[3.7] control security with session.[read|write]_security")
+    @deprecated("[3.7] execute is now unsafe by default in hooks/operation. You"
+                " can also control security with session.[read|write]_security")
     def unsafe_execute(self, rql, kwargs=None, eid_key=None, build_descr=True,
                        propagate=False):
         """like .execute but with security checking disabled (this method is
         internal to the server, it's not part of the db-api)
         """
-        return self.execute(rql, kwargs, eid_key, build_descr)
+        with security_enabled(self, read=False, write=False):
+            return self.execute(rql, kwargs, eid_key, build_descr)
 
     @property
     @deprecated("[3.7] is_super_session is deprecated, test "