cubicweb/server/repository.py
changeset 12034 e7e469d0539b
parent 12030 72c3af2cde23
child 12036 4c2c731f9190
equal deleted inserted replaced
12033:1ce12b716e71 12034:e7e469d0539b
   668     @contextmanager
   668     @contextmanager
   669     def internal_cnx(self):
   669     def internal_cnx(self):
   670         """Context manager returning a Connection using internal user which have
   670         """Context manager returning a Connection using internal user which have
   671         every access rights on the repository.
   671         every access rights on the repository.
   672 
   672 
   673         Beware that unlike the older :meth:`internal_session`, internal
   673         Internal connections have all hooks beside security enabled.
   674         connections have all hooks beside security enabled.
       
   675         """
   674         """
   676         with Session(InternalManager(), self).new_cnx() as cnx:
   675         with Session(InternalManager(), self).new_cnx() as cnx:
   677             cnx.user._cw = cnx  # XXX remove when "vreg = user._cw.vreg" hack in entity.py is gone
   676             cnx.user._cw = cnx  # XXX remove when "vreg = user._cw.vreg" hack in entity.py is gone
   678             with cnx.security_enabled(read=False, write=False):
   677             with cnx.security_enabled(read=False, write=False):
   679                 yield cnx
   678                 yield cnx