equal
deleted
inserted
replaced
404 |
404 |
405 # security control ######################################################### |
405 # security control ######################################################### |
406 |
406 |
407 DEFAULT_SECURITY = object() # evaluated to true by design |
407 DEFAULT_SECURITY = object() # evaluated to true by design |
408 |
408 |
|
409 def security_enabled(self, read=False, write=False): |
|
410 return security_enabled(self, read=read, write=write) |
|
411 |
409 @property |
412 @property |
410 def read_security(self): |
413 def read_security(self): |
411 """return a boolean telling if read security is activated or not""" |
414 """return a boolean telling if read security is activated or not""" |
412 txstore = self._threaddata |
415 txstore = self._threaddata |
413 if txstore is None: |
416 if txstore is None: |
488 # hooks activation control ################################################# |
491 # hooks activation control ################################################# |
489 # all hooks should be activated during normal execution |
492 # all hooks should be activated during normal execution |
490 |
493 |
491 HOOKS_ALLOW_ALL = object() |
494 HOOKS_ALLOW_ALL = object() |
492 HOOKS_DENY_ALL = object() |
495 HOOKS_DENY_ALL = object() |
|
496 |
|
497 def allow_all_hooks_but(self, *categories): |
|
498 return hooks_control(self, self.HOOKS_ALLOW_ALL, *categories) |
|
499 def deny_all_hooks_but(self, *categories): |
|
500 return hooks_control(self, self.HOOKS_DENY_ALL, *categories) |
493 |
501 |
494 @property |
502 @property |
495 def hooks_mode(self): |
503 def hooks_mode(self): |
496 return getattr(self._threaddata, 'hooks_mode', self.HOOKS_ALLOW_ALL) |
504 return getattr(self._threaddata, 'hooks_mode', self.HOOKS_ALLOW_ALL) |
497 |
505 |