[dbapi] retire repo.user_info which was used by the dbapi
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 17 Mar 2015 15:46:40 +0100
changeset 10338 f738180d499d
parent 10337 c8bb743850c9
child 10339 5dc6dc2c0de9
[dbapi] retire repo.user_info which was used by the dbapi Related to #3933480.
req.py
server/repository.py
server/test/unittest_repository.py
--- a/req.py	Tue Mar 17 15:41:54 2015 +0100
+++ b/req.py	Tue Mar 17 15:46:40 2015 +0100
@@ -81,7 +81,6 @@
         A special method is needed to ensure the linked user is linked to the
         connection too.
         """
-        # cnx validity is checked by the call to .user_info
         rset = self.eid_rset(orig_user.eid, 'CWUser')
         user_cls = self.vreg['etypes'].etype_class('CWUser')
         user = user_cls(self, rset, row=0, groups=orig_user.groups,
--- a/server/repository.py	Tue Mar 17 15:41:54 2015 +0100
+++ b/server/repository.py	Tue Mar 17 15:46:40 2015 +0100
@@ -743,15 +743,6 @@
         session = self._get_session(sessionid)
         return session._cnx.call_service(regid, **kwargs)
 
-    def user_info(self, sessionid, props=None):
-        """this method should be used by client to:
-        * check session id validity
-        * update user information on each user's request (i.e. groups and
-          custom properties)
-        """
-        user = self._get_session(sessionid, setcnxset=False).user
-        return user.eid, user.login, user.groups, user.properties
-
     def undoable_transactions(self, sessionid, ueid=None, txid=None,
                               **actionfilters):
         """See :class:`cubicweb.dbapi.Connection.undoable_transactions`"""
--- a/server/test/unittest_repository.py	Tue Mar 17 15:41:54 2015 +0100
+++ b/server/test/unittest_repository.py	Tue Mar 17 15:46:40 2015 +0100
@@ -236,13 +236,6 @@
         # .properties() return a result set
         self.assertEqual(self.repo.properties().rql, 'Any K,V WHERE P is CWProperty,P pkey K, P value V, NOT P for_user U')
 
-    def test_session_api(self):
-        repo = self.repo
-        cnxid = repo.connect(self.admlogin, password=self.admpassword)
-        self.assertEqual(repo.user_info(cnxid), (6, 'admin', set([u'managers']), {}))
-        repo.close(cnxid)
-        self.assertRaises(BadConnectionId, repo.user_info, cnxid)
-
     def test_shared_data_api(self):
         repo = self.repo
         cnxid = repo.connect(self.admlogin, password=self.admpassword)