server/sources/native.py
changeset 4943 7f5b83578fec
parent 4913 083b4d454192
child 4964 d9e8af8a7a42
equal deleted inserted replaced
4940:3143a1258d62 4943:7f5b83578fec
    33 from cubicweb.cwconfig import CubicWebNoAppConfiguration
    33 from cubicweb.cwconfig import CubicWebNoAppConfiguration
    34 from cubicweb.server import hook
    34 from cubicweb.server import hook
    35 from cubicweb.server.utils import crypt_password
    35 from cubicweb.server.utils import crypt_password
    36 from cubicweb.server.sqlutils import SQL_PREFIX, SQLAdapterMixIn
    36 from cubicweb.server.sqlutils import SQL_PREFIX, SQLAdapterMixIn
    37 from cubicweb.server.rqlannotation import set_qdata
    37 from cubicweb.server.rqlannotation import set_qdata
    38 from cubicweb.server.session import hooks_control
    38 from cubicweb.server.session import hooks_control, security_enabled
    39 from cubicweb.server.sources import AbstractSource, dbg_st_search, dbg_results
    39 from cubicweb.server.sources import AbstractSource, dbg_st_search, dbg_results
    40 from cubicweb.server.sources.rql2sql import SQLGenerator
    40 from cubicweb.server.sources.rql2sql import SQLGenerator
    41 
    41 
    42 
    42 
    43 ATTR_MAP = {}
    43 ATTR_MAP = {}
   750         """See :class:`cubicweb.dbapi.Connection.undo_transaction`"""
   750         """See :class:`cubicweb.dbapi.Connection.undo_transaction`"""
   751         # set mode so pool isn't released subsquently until commit/rollback
   751         # set mode so pool isn't released subsquently until commit/rollback
   752         session.mode = 'write'
   752         session.mode = 'write'
   753         errors = []
   753         errors = []
   754         with hooks_control(session, session.HOOKS_DENY_ALL, 'integrity'):
   754         with hooks_control(session, session.HOOKS_DENY_ALL, 'integrity'):
   755             for action in reversed(self.tx_actions(session, txuuid, False)):
   755             with security_enabled(session, read=False):
   756                 undomethod = getattr(self, '_undo_%s' % action.action.lower())
   756                 for action in reversed(self.tx_actions(session, txuuid, False)):
   757                 errors += undomethod(session, action)
   757                     undomethod = getattr(self, '_undo_%s' % action.action.lower())
       
   758                     errors += undomethod(session, action)
   758         # remove the transactions record
   759         # remove the transactions record
   759         self.doexec(session,
   760         self.doexec(session,
   760                     "DELETE FROM transactions WHERE tx_uuid='%s'" % txuuid)
   761                     "DELETE FROM transactions WHERE tx_uuid='%s'" % txuuid)
   761         return errors
   762         return errors
   762 
   763