server/test/unittest_security.py
changeset 9990 c84ad981fc4a
parent 9954 79d34ba48612
parent 9984 793377697c81
child 10136 c33dcd18e0bb
--- a/server/test/unittest_security.py	Tue Sep 23 17:34:36 2014 +0200
+++ b/server/test/unittest_security.py	Thu Sep 25 15:49:13 2014 +0200
@@ -423,6 +423,21 @@
             self.assertRaises(Unauthorized, cnx.commit)
             cnx.execute('SET X web "http://www.logilab.org" WHERE X eid %(x)s', {'x': eid})
             cnx.commit()
+        with self.new_access('iaminusersgrouponly').repo_cnx() as cnx:
+            cnx.execute('INSERT Frozable F: F name "Foo"')
+            cnx.commit()
+            cnx.execute('SET F name "Bar" WHERE F is Frozable')
+            cnx.commit()
+            cnx.execute('SET F name "BaBar" WHERE F is Frozable')
+            cnx.execute('SET F frozen True WHERE F is Frozable')
+            with self.assertRaises(Unauthorized):
+                cnx.commit()
+            cnx.rollback()
+            cnx.execute('SET F frozen True WHERE F is Frozable')
+            cnx.commit()
+            cnx.execute('SET F name "Bar" WHERE F is Frozable')
+            with self.assertRaises(Unauthorized):
+                cnx.commit()
 
     def test_attribute_security_rqlexpr(self):
         with self.admin_access.repo_cnx() as cnx: