server/test/unittest_security.py
changeset 4764 ec9c20c6b9f7
parent 4711 7ef3b029e10b
child 4787 dc07678c4935
equal deleted inserted replaced
4763:81b0df087375 4764:ec9c20c6b9f7
   434         #                  {'x': self.user.eid})
   434         #                  {'x': self.user.eid})
   435 
   435 
   436         rset = cu.execute('CWUser X WHERE X eid %(x)s', {'x': anon.eid}, 'x')
   436         rset = cu.execute('CWUser X WHERE X eid %(x)s', {'x': anon.eid}, 'x')
   437         self.assertEquals(rset.rows, [[anon.eid]])
   437         self.assertEquals(rset.rows, [[anon.eid]])
   438         # but can't modify it
   438         # but can't modify it
   439         cu.execute('SET X login "toto" WHERE X eid %(x)s', {'x': anon.eid})
   439         self.assertRaises(Unauthorized,
   440         self.assertRaises(Unauthorized, cnx.commit)
   440                           cu.execute, 'SET X login "toto" WHERE X eid %(x)s', {'x': anon.eid})
   441 
   441 
   442     def test_in_group_relation(self):
   442     def test_in_group_relation(self):
   443         cnx = self.login('iaminusersgrouponly')
   443         cnx = self.login('iaminusersgrouponly')
   444         cu = cnx.cursor()
   444         cu = cnx.cursor()
   445         rql = u"DELETE U in_group G WHERE U login 'admin'"
   445         rql = u"DELETE U in_group G WHERE U login 'admin'"