server/session.py
branchstable
changeset 4992 398cc8b39aec
parent 4987 ec93dd82c83f
child 5014 96bb4e7e3348
equal deleted inserted replaced
4991:16f0cec3d008 4992:398cc8b39aec
   153     def hijack_user(self, user):
   153     def hijack_user(self, user):
   154         """return a fake request/session using specified user"""
   154         """return a fake request/session using specified user"""
   155         session = Session(user, self.repo)
   155         session = Session(user, self.repo)
   156         threaddata = session._threaddata
   156         threaddata = session._threaddata
   157         threaddata.pool = self.pool
   157         threaddata.pool = self.pool
       
   158         # share pending_operations, else operation added in the hi-jacked
       
   159         # session such as SendMailOp won't ever be processed
       
   160         threaddata.pending_operations = self.pending_operations
   158         # everything in transaction_data should be copied back but the entity
   161         # everything in transaction_data should be copied back but the entity
   159         # type cache we don't want to avoid security pb
   162         # type cache we don't want to avoid security pb
   160         threaddata.transaction_data = self.transaction_data.copy()
   163         threaddata.transaction_data = self.transaction_data.copy()
   161         threaddata.transaction_data.pop('ecache', None)
   164         threaddata.transaction_data.pop('ecache', None)
   162         return session
   165         return session