equal
deleted
inserted
replaced
191 def fix_user_classes(self): |
191 def fix_user_classes(self): |
192 # After registry reload the 'CWUser' class used for CWEtype |
192 # After registry reload the 'CWUser' class used for CWEtype |
193 # changed. So any existing user object have a different class than |
193 # changed. So any existing user object have a different class than |
194 # the new loaded one. We are hot fixing this. |
194 # the new loaded one. We are hot fixing this. |
195 usercls = self.vreg['etypes'].etype_class('CWUser') |
195 usercls = self.vreg['etypes'].etype_class('CWUser') |
196 for session in self._sessions.itervalues(): |
196 for session in self._sessions.values(): |
197 if not isinstance(session.user, InternalManager): |
197 if not isinstance(session.user, InternalManager): |
198 session.user.__class__ = usercls |
198 session.user.__class__ = usercls |
199 |
199 |
200 def init_cnxset_pool(self): |
200 def init_cnxset_pool(self): |
201 """should be called bootstrap_repository, as this is what it does""" |
201 """should be called bootstrap_repository, as this is what it does""" |
309 # trigger full reload of all appobjects |
309 # trigger full reload of all appobjects |
310 self.vreg.set_schema(schema) |
310 self.vreg.set_schema(schema) |
311 else: |
311 else: |
312 self.vreg._set_schema(schema) |
312 self.vreg._set_schema(schema) |
313 self.querier.set_schema(schema) |
313 self.querier.set_schema(schema) |
314 for source in self.sources_by_uri.itervalues(): |
314 for source in self.sources_by_uri.values(): |
315 source.set_schema(schema) |
315 source.set_schema(schema) |
316 self.schema = schema |
316 self.schema = schema |
317 |
317 |
318 def deserialize_schema(self): |
318 def deserialize_schema(self): |
319 """load schema from the database""" |
319 """load schema from the database""" |
435 """validate authentication, raise AuthenticationError on failure, return |
435 """validate authentication, raise AuthenticationError on failure, return |
436 associated CWUser's eid on success. |
436 associated CWUser's eid on success. |
437 """ |
437 """ |
438 # iter on sources_by_uri then check enabled source since sources doesn't |
438 # iter on sources_by_uri then check enabled source since sources doesn't |
439 # contain copy based sources |
439 # contain copy based sources |
440 for source in self.sources_by_uri.itervalues(): |
440 for source in self.sources_by_uri.values(): |
441 if self.config.source_enabled(source) and source.support_entity('CWUser'): |
441 if self.config.source_enabled(source) and source.support_entity('CWUser'): |
442 try: |
442 try: |
443 return source.authenticate(cnx, login, **authinfo) |
443 return source.authenticate(cnx, login, **authinfo) |
444 except AuthenticationError: |
444 except AuthenticationError: |
445 continue |
445 continue |