server/session.py
changeset 8561 77ea3eed9946
parent 8555 c747242d22a6
child 8562 0d2fb4604265
equal deleted inserted replaced
8560:fef0b8214fcf 8561:77ea3eed9946
   106        with hooks_control(self.session, self.session.HOOKS_ALLOW_ALL, 'integrity'):
   106        with hooks_control(self.session, self.session.HOOKS_ALLOW_ALL, 'integrity'):
   107            # ... do stuff with all but 'integrity' hooks activated
   107            # ... do stuff with all but 'integrity' hooks activated
   108 
   108 
   109        with hooks_control(self.session, self.session.HOOKS_DENY_ALL, 'integrity'):
   109        with hooks_control(self.session, self.session.HOOKS_DENY_ALL, 'integrity'):
   110            # ... do stuff with none but 'integrity' hooks activated
   110            # ... do stuff with none but 'integrity' hooks activated
       
   111 
       
   112     This is an internal api, you should rather use
       
   113     :meth:`~cubicweb.server.session.Session.deny_all_hooks_but` or
       
   114     :meth:`~cubicweb.server.session.Session.allow_all_hooks_but` session
       
   115     methods.
   111     """
   116     """
   112     def __init__(self, session, mode, *categories):
   117     def __init__(self, session, mode, *categories):
   113         self.session = session
   118         self.session = session
   114         self.mode = mode
   119         self.mode = mode
   115         self.categories = categories
   120         self.categories = categories
   215       `HOOKS_ALLOW_ALL`, this set contains hooks categories that are disabled.
   220       `HOOKS_ALLOW_ALL`, this set contains hooks categories that are disabled.
   216 
   221 
   217 
   222 
   218       :attr:`running_dbapi_query`, boolean flag telling if the executing query
   223       :attr:`running_dbapi_query`, boolean flag telling if the executing query
   219       is coming from a dbapi connection or is a query from within the repository
   224       is coming from a dbapi connection or is a query from within the repository
       
   225 
       
   226     .. automethod:: cubicweb.server.session.deny_all_hooks_but
       
   227     .. automethod:: cubicweb.server.session.all_all_hooks_but
   220     """
   228     """
   221     is_request = False
   229     is_request = False
   222     is_internal_session = False
   230     is_internal_session = False
   223 
   231 
   224     def __init__(self, user, repo, cnxprops=None, _id=None):
   232     def __init__(self, user, repo, cnxprops=None, _id=None):