689 every access rights on the repository. |
689 every access rights on the repository. |
690 |
690 |
691 Beware that unlike the older :meth:`internal_session`, internal |
691 Beware that unlike the older :meth:`internal_session`, internal |
692 connections have all hooks beside security enabled. |
692 connections have all hooks beside security enabled. |
693 """ |
693 """ |
694 with Session(InternalManager(), self) as session: |
694 with Session(InternalManager(), self).new_cnx() as cnx: |
695 with session.new_cnx() as cnx: |
695 cnx.user._cw = cnx # XXX remove when "vreg = user._cw.vreg" |
696 cnx.user._cw = cnx # XXX remove when "vreg = user._cw.vreg" |
696 # hack in entity.py is gone |
697 # hack in entity.py is gone |
697 with cnx.security_enabled(read=False, write=False): |
698 with cnx.security_enabled(read=False, write=False): |
698 yield cnx |
699 yield cnx |
|
700 |
699 |
701 def _get_session(self, sessionid, txid=None, checkshuttingdown=True): |
700 def _get_session(self, sessionid, txid=None, checkshuttingdown=True): |
702 """return the session associated with the given session identifier""" |
701 """return the session associated with the given session identifier""" |
703 if checkshuttingdown and self.shutting_down: |
702 if checkshuttingdown and self.shutting_down: |
704 raise ShuttingDown('Repository is shutting down') |
703 raise ShuttingDown('Repository is shutting down') |