server/session.py
branchstable
changeset 7405 8c752d113ebb
parent 7340 9303fd71c2ee
child 7406 e772a2c57b00
child 7451 48ba5f0c11de
--- a/server/session.py	Thu May 19 17:53:01 2011 +0200
+++ b/server/session.py	Thu May 19 17:53:46 2011 +0200
@@ -406,6 +406,9 @@
 
     DEFAULT_SECURITY = object() # evaluated to true by design
 
+    def security_enabled(self, read=False, write=False):
+        return security_enabled(self, read=read, write=write)
+
     @property
     def read_security(self):
         """return a boolean telling if read security is activated or not"""
@@ -491,6 +494,11 @@
     HOOKS_ALLOW_ALL = object()
     HOOKS_DENY_ALL = object()
 
+    def allow_all_hooks_but(self, *categories):
+        return hooks_control(self, self.HOOKS_ALLOW_ALL, *categories)
+    def deny_all_hooks_but(self, *categories):
+        return hooks_control(self, self.HOOKS_DENY_ALL, *categories)
+
     @property
     def hooks_mode(self):
         return getattr(self._threaddata, 'hooks_mode', self.HOOKS_ALLOW_ALL)