server/test/unittest_migractions.py
changeset 10799 ec97974b9010
parent 10662 10942ed172de
child 10800 1e4ddf5ee9ad
--- a/server/test/unittest_migractions.py	Thu Oct 08 13:51:54 2015 +0200
+++ b/server/test/unittest_migractions.py	Wed Sep 16 16:04:17 2015 +0200
@@ -784,6 +784,20 @@
             self.assertEqual(self.schema['whatever'].subjects(), ('Company',))
             self.assertFalse(self.table_sql(mh, 'whatever_relation'))
 
+    def test_computed_relation_sync_schema_props_perms_security(self):
+        with self.mh() as (cnx, mh):
+            rdef = next(self.schema['perm_changes'].rdefs.itervalues())
+            self.assertEqual(rdef.permissions,
+                             {'add': (), 'delete': (),
+                              'read': ('managers', 'users')})
+            mh.cmd_sync_schema_props_perms('perm_changes')
+            self.assertEqual(self.schema['perm_changes'].permissions,
+                             {'read': ('managers',)})
+            rdef = next(self.schema['perm_changes'].rdefs.itervalues())
+            self.assertEqual(rdef.permissions,
+                             {'add': (), 'delete': (),
+                              'read': ('managers',)})
+
     def test_computed_relation_sync_schema_props_perms_on_rdef(self):
         self.assertIn('whatever', self.schema)
         with self.mh() as (cnx, mh):